Re: Problem with Templating ... I'm new....

James Abbatiello <[email protected]> Wed, 22 Jun 2011 01:17:43 -0400
Newsgroups gmane.comp.python.cheetah
Message-ID <[email protected]>
--===============5779846441837721058==
Content-Type: multipart/alternative; boundary=20cf302d49be92f19404a64616e7

--20cf302d49be92f19404a64616e7
Content-Type: text/plain; charset=ISO-8859-1

Have you tried ${idevice_list[$idevice]["battery"][0:5]} ?

I don't know what might be causing your other problem.  Are you sure that
something else isn't escaping it before it gets to Cheetah?

-- 
James Abbatiello


On Tue, Jun 21, 2011 at 2:39 PM, Benjamin Schollnick <
[email protected]> wrote:

> Folks,
>
> I'm starting out with Cheetah, and while I have had some success... I'm
> having an issue with Filters...
>
> 1) I need to be able to restrict the output to let's say 5 characters, and this doesn't seem to work..
>
>           <TD>${idevice_list[$idevice]["battery"], maxlen=5}</td>
>
> 2) the $insert_map_js needs to be unfiltered, it appears to be changed
> inside of cheetah's tempting to be "web safe".  I have tried :
>
>                           ${insert_map_js, raw)
>
> and receive an error, that raw is unknown.  I've tried #raw & #end raw,
> but that doesn't seem to work...  Any suggestions?  I believe I have the syntax right...  Any assistance would be appreciated.
>
>          - Benjamin
>
>
> ---Template ---
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
>   <head>
>     <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
> <link rel="stylesheet" type="text/css" href="css/Find-my-iDevices.css">
> <title>Find my iDevices</title>
> $insert_map_js
> </Head>
>
>   <body onload="load()" onunload="GUnload()">
> <table Border=1>
> <TD><B>Name of iDevice</B></td>
> <TD><B>iDevice Type</B></td>
> <TD><B>Revision</B></td>
> <TD><B>Charging Status</B></td>
> <TD><B>Battery Level</B></td>
> <TD><B>Latitude</B></td>
> <TD><B>Longitude</B></td>
> <TD><B>Accuracy</B></td>
> </tr><TR>
> #for $idevice in $idevice_list
> <tr><TD>$idevice</TD>
> <TD>$idevice_list[$idevice]["class"]</td>
> <TD>$idevice_list[$idevice]["deviceModel"]</td>
> <TD>$idevice_list[$idevice]["charging"]</td>
> <TD>${idevice_list[$idevice]["battery"], maxlen=5}</td>
> <TD>$idevice_list[$idevice]["location"]["latitude"]</td>
> <TD>$idevice_list[$idevice]["location"]["longitude"]</td>
> <TD>$idevice_list[$idevice]["location"]["accuracy"]</td>
> </TR>
> #end for
> </table>
> <hr>
>     <div id="map" style="width: 1000px; height: 600px"></div>
> </body>
>
>
>
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> Cheetahtemplate-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
>
>

--20cf302d49be92f19404a64616e7
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Have you tried ${idevice_list[$idevice][&quot;battery&quot;][0:5]} ?<br><br=
>I don&#39;t know what might be causing your other problem.=A0 Are you sure=
 that something else isn&#39;t escaping it before it gets to Cheetah?<br><b=
r>
-- <br>James Abbatiello<br><br><br><div class=3D"gmail_quote">On Tue, Jun 2=
1, 2011 at 2:39 PM, Benjamin Schollnick <span dir=3D"ltr">&lt;<a href=3D"ma=
ilto:[email protected]">[email protected]</a>&gt;</span> wrote:=
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;"><span style=3D"font-family:Times;font-size:=
medium"><pre style=3D"word-wrap:break-word;white-space:pre-wrap">Folks,

I&#39;m starting out with Cheetah, and while I have had some success... I&#=
39;m
having an issue with Filters...

1) I need to be able to restrict the output to let&#39;s say 5 characters, =
and this doesn&#39;t seem to work..
<br></pre><pre style=3D"word-wrap:break-word;white-space:pre-wrap">        =
  &lt;TD&gt;${idevice_list[$idevice][&quot;battery&quot;], maxlen=3D5}&lt;/=
td&gt;

2) the $insert_map_js needs to be unfiltered, it appears to be changed
inside of cheetah&#39;s tempting to be &quot;web safe&quot;.  I have tried =
:
<br></pre><pre style=3D"word-wrap:break-word;white-space:pre-wrap">        =
                  ${insert_map_js, raw)

and receive an error, that raw is unknown.  I&#39;ve tried #raw &amp; #end =
raw,
but that doesn&#39;t seem to work...  Any suggestions?  I believe I have th=
e syntax right...  Any assistance would be appreciated.

         - Benjamin


---Template ---
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
&quot;<a href=3D"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" target=
=3D"_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</a>&quot;&gt;
&lt;html xmlns=3D&quot;<a href=3D"http://www.w3.org/1999/xhtml" target=3D"_=
blank">http://www.w3.org/1999/xhtml</a>&quot;&gt;
  &lt;head&gt;
    &lt;meta http-equiv=3D&quot;content-type&quot; content=3D&quot;text/htm=
l; charset=3Dutf-8&quot;/&gt;
&lt;link rel=3D&quot;stylesheet&quot; type=3D&quot;text/css&quot; href=3D&q=
uot;css/Find-my-iDevices.css&quot;&gt;
&lt;title&gt;Find my iDevices&lt;/title&gt;
$insert_map_js
&lt;/Head&gt;

  &lt;body onload=3D&quot;load()&quot; onunload=3D&quot;GUnload()&quot;&gt;
&lt;table Border=3D1&gt;
&lt;TD&gt;&lt;B&gt;Name of iDevice&lt;/B&gt;&lt;/td&gt;
&lt;TD&gt;&lt;B&gt;iDevice Type&lt;/B&gt;&lt;/td&gt;
&lt;TD&gt;&lt;B&gt;Revision&lt;/B&gt;&lt;/td&gt;
&lt;TD&gt;&lt;B&gt;Charging Status&lt;/B&gt;&lt;/td&gt;
&lt;TD&gt;&lt;B&gt;Battery Level&lt;/B&gt;&lt;/td&gt;
&lt;TD&gt;&lt;B&gt;Latitude&lt;/B&gt;&lt;/td&gt;
&lt;TD&gt;&lt;B&gt;Longitude&lt;/B&gt;&lt;/td&gt;
&lt;TD&gt;&lt;B&gt;Accuracy&lt;/B&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;TR&gt;
#for $idevice in $idevice_list
&lt;tr&gt;&lt;TD&gt;$idevice&lt;/TD&gt;
&lt;TD&gt;$idevice_list[$idevice][&quot;class&quot;]&lt;/td&gt;
&lt;TD&gt;$idevice_list[$idevice][&quot;deviceModel&quot;]&lt;/td&gt;
&lt;TD&gt;$idevice_list[$idevice][&quot;charging&quot;]&lt;/td&gt;
&lt;TD&gt;${idevice_list[$idevice][&quot;battery&quot;], maxlen=3D5}&lt;/td=
&gt;
&lt;TD&gt;$idevice_list[$idevice][&quot;location&quot;][&quot;latitude&quot=
;]&lt;/td&gt;
&lt;TD&gt;$idevice_list[$idevice][&quot;location&quot;][&quot;longitude&quo=
t;]&lt;/td&gt;
&lt;TD&gt;$idevice_list[$idevice][&quot;location&quot;][&quot;accuracy&quot=
;]&lt;/td&gt;
&lt;/TR&gt;
#end for
&lt;/table&gt;
&lt;hr&gt;
    &lt;div id=3D&quot;map&quot; style=3D&quot;width: 1000px; height: 600px=
&quot;&gt;&lt;/div&gt;
&lt;/body&gt;
</pre><div><br></div></span>
<br>-----------------------------------------------------------------------=
-------<br>
EditLive Enterprise is the world&#39;s most technically advanced content<br=
>
authoring tool. Experience the power of Track Changes, Inline Image<br>
Editing and ensure content is compliant with Accessibility Checking.<br>
<a href=3D"http://p.sf.net/sfu/ephox-dev2dev" target=3D"_blank">http://p.sf=
.net/sfu/ephox-dev2dev</a><br>_____________________________________________=
__<br>
Cheetahtemplate-discuss mailing list<br>
<a href=3D"mailto:[email protected]">Cheetahtem=
[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-dis=
cuss" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/cheeta=
htemplate-discuss</a><br>
<br></blockquote></div><br>

--20cf302d49be92f19404a64616e7--


--===============5779846441837721058==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
--===============5779846441837721058==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

--===============5779846441837721058==--