Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

cheetah-archive · Cheetah Template System Archive

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 3
  • Category: Web Design
  • Founded: Jul 18, 2001
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 5005 - 5014 of 5014   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#5005 From: Analog Kid <ajdeshpande@...>
Date: Tue Jan 8, 2013 12:07 pm
Subject: [Cheetahtemplate-discuss] Manipulating HTML tag attributes
ajdeshpande@...
Send Email Send Email
 
Hi All:

Im a noob to Cheetah. I had a question: I have a .py file which uses a .tmpl template file to render some html. In the template, I need to manipulate an HTML tag attribute. Something like this:
... snip
<select name=category value=req.category>
  <option value="cars">Cars</option>
  ...................
...snip

I call this template from the py file like this:

#!/usr/local/bin/python
from cgi import parse
from Cheetah.Template import Template

print "Content-Type: text/html\n"
req=parse()
print Template(file="somepage.tmpl", searchList = [{'req': req}])


This doesnt seem to work. Am I passing parameters correctly. What am I missing?

TIA,
Ajay

------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

#5006 From: Daniel Winter <winniwinter@...>
Date: Sun Mar 24, 2013 8:55 pm
Subject: [Cheetahtemplate-discuss] Inserting additional placeholders
winniwinter@...
Send Email Send Email
 
Hi,

I want to use cheetah with cherryPy. To make things easier I created a helper that searches existing templates creates a instance of the cheetah Template class and returns it.
Then I want to be able to add data to the searchList. But I couldn't find any method that allows me to add new data to the searchList.
The only solution for me was to get a reference of the  searchList and append my data there. But I don't think that this is the right way to do it.

This is basically what i do:


#return the template
    def get_template(self, template):

        

        self.current_template = template + self.FILE_EXTENSION

        

        if (os.path.isfile(os.path.join(self.base_dir, self.current_template))):

            

            tmpl = Template(file = os.path.join(self.base_dir, self.current_template))

            return tmpl



---------------

# returns the template instance
        tmpl = cherrypy.engine.publish("lookup-template", template).pop()

        

#get the searchList

        searchlist = tmpl.searchList()

        

#add the data to the searchList

        searchlist.append(data)

#set the response body
        cherrypy.response.body = str(tmpl)



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

#5007 From: "Redhorse, Olivia J. (WSTF-RD)[Jacobs Technology Inc]" <olivia.j.redhorse@...>
Date: Thu Apr 25, 2013 9:39 pm
Subject: [Cheetahtemplate-discuss] Displaying 50 records per page using Cheetah
olivia.j.redhorse@...
Send Email Send Email
 
Hello All,
I am fairly new to using Cheetah and Python.  I am planning to create a page that displays 50 records per page based on a search criteria.  The user would be provided the option to go to the next or previous 50 records on the page.  This is a new area for me.  How can create a page like this?  Any suggestions or other resources would be very helpful.  I appreciate your input. -Olivia
 
 
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

#5008 From: Daniel Winter <winniwinter@...>
Date: Fri Apr 26, 2013 8:31 am
Subject: Re: [Cheetahtemplate-discuss] Displaying 50 records per page using Cheetah
winniwinter@...
Send Email Send Email
 
That means you want to display data in a table with pagination?

Something like: http://www.datatables.net/ ?

That's a jQuery Plugin that can transform your html table. It also allows you to add filter and pagination options..
gruß,
daniel

On 25 Apr, 2013,at 11:39 PM, "Redhorse, Olivia J. (WSTF-RD)[Jacobs Technology Inc]" <olivia.j.redhorse@...> wrote:

Hello All,
I am fairly new to using Cheetah and Python.  I am planning to create a page that displays 50 records per page based on a search criteria.  The user would be provided the option to go to the next or previous 50 records on the page.  This is a new area for me.  How can create a page like this?  Any suggestions or other resources would be very helpful.  I appreciate your input. -Olivia
 
 
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

#5009 From: "Redhorse, Olivia J. (WSTF-RD)[Jacobs Technology Inc]" <olivia.j.redhorse@...>
Date: Fri Apr 26, 2013 4:11 pm
Subject: Re: [Cheetahtemplate-discuss] Displaying 50 records per page using Cheetah
olivia.j.redhorse@...
Send Email Send Email
 

Yes, this looks like something I can use.  I am going to try it. Thanks J

 

From: Daniel Winter [mailto:winniwinter@...]
Sent: Friday, April 26, 2013 2:31 AM
To: Redhorse, Olivia J. (WSTF-RD)[Jacobs Technology Inc]
Cc: cheetahtemplate-discuss@...
Subject: Re: [Cheetahtemplate-discuss] Displaying 50 records per page using Cheetah

 

That means you want to display data in a table with pagination?

 

Something like: http://www.datatables.net/ ?

 

That's a jQuery Plugin that can transform your html table. It also allows you to add filter and pagination options..

gruß,
daniel


On 25 Apr, 2013,at 11:39 PM, "Redhorse, Olivia J. (WSTF-RD)[Jacobs Technology Inc]" <olivia.j.redhorse@...> wrote:

Hello All,

I am fairly new to using Cheetah and Python.  I am planning to create a page that displays 50 records per page based on a search criteria.  The user would be provided the option to go to the next or previous 50 records on the page.  This is a new area for me.  How can create a page like this?  Any suggestions or other resources would be very helpful.  I appreciate your input. -Olivia

 

 

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr

_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

#5010 From: "Redhorse, Olivia J. (WSTF-RD)[Jacobs Technology Inc]" <olivia.j.redhorse@...>
Date: Fri Apr 26, 2013 6:44 pm
Subject: Re: [Cheetahtemplate-discuss] Displaying 50 records per page using Cheetah
olivia.j.redhorse@...
Send Email Send Email
 

I have been playing with dataTables and I have a question.  I was not sure if dataTables was going to work inside a *.tmpl file (cheetah file).  When I test plain html (not using cheetah), datatables works fine.  But when I try to use dataTables in a *.tmpl (a cheetah file) I get an error message, invalid character (in the browser), on the following code.

 

<script type="text/javascript">

window.onload = (function() { $('#table_id').dataTable();} );

</script>

 

It is having a problem resolving the dollar sign ($) in the code.  I know it is related to the fact that in a cheetah file, the dollar sign means a variable is declared.  How do I resolve this?  Or am I understanding this incorrectly?

 

From: Daniel Winter [mailto:winniwinter@...]
Sent: Friday, April 26, 2013 2:31 AM
To: Redhorse, Olivia J. (WSTF-RD)[Jacobs Technology Inc]
Cc: cheetahtemplate-discuss@...
Subject: Re: [Cheetahtemplate-discuss] Displaying 50 records per page using Cheetah

 

That means you want to display data in a table with pagination?

 

Something like: http://www.datatables.net/ ?

 

That's a jQuery Plugin that can transform your html table. It also allows you to add filter and pagination options..

gruß,
daniel


On 25 Apr, 2013,at 11:39 PM, "Redhorse, Olivia J. (WSTF-RD)[Jacobs Technology Inc]" <olivia.j.redhorse@...> wrote:

Hello All,

I am fairly new to using Cheetah and Python.  I am planning to create a page that displays 50 records per page based on a search criteria.  The user would be provided the option to go to the next or previous 50 records on the page.  This is a new area for me.  How can create a page like this?  Any suggestions or other resources would be very helpful.  I appreciate your input. -Olivia

 

 

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr

_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

#5011 From: Juha Tuomala <Juha.Tuomala@...>
Date: Sat Apr 27, 2013 10:12 am
Subject: Re: [Cheetahtemplate-discuss] Displaying 50 records per page using Cheetah
Juha.Tuomala@...
Send Email Send Email
 
On Fri, 26 Apr 2013, Redhorse, Olivia J. (WSTF-RD)[Jacobs Technology Inc] wrote:
> I have been playing with dataTables and I have a question.  I was
> not sure if dataTables was going to work inside a *.tmpl file
> (cheetah file).  When I test plain html (not using cheetah),
> datatables works fine.  But when I try to use dataTables in a
> *.tmpl (a cheetah file) I get an error message, invalid character
> (in the browser), on the following code.
>
> <script type="text/javascript">
> window.onload = (function() { $('#table_id').dataTable();} );
> </script>

> It is having a problem resolving the dollar sign ($) in the code.  I know it
is related to the fact that in a cheetah file, the dollar sign means a
> variable is declared.  How do I resolve this?  Or am I understanding this
incorrectly?

Cheetah has a directive called '#raw' that can hold stuff that does
not get parsed. Try that with your template.


Tuju

--
Säästämisen ja ahkeroinnin tilalle syntyi varsinkin 1960-luvulta lähtien
oman
onnellisuuden ympärillä pyörivä, vastuuton ajattelutapa, joka korostaa
oikeuksia
velvollisuuksien sijaan. - Paul Lillrank
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

#5012 From: Aaron Murray <aaron@...>
Date: Thu May 16, 2013 9:13 pm
Subject: [Cheetahtemplate-discuss] Upgrading from 0.9 to 2.4.4 and getting errors (natch)
aaron@...
Send Email Send Email
 
I have been tasked with upgrading my company's ancient installation of Cheetah.

My templates are compiling, but I'm getting a number of strange errors and I can't find the root cause.  I'm trying to figure out a systematic way to upgrade the templates, but so far information is scarce.

Below is an example:

#set formUtil = $iLib.aquariumFactory("widget.FormUtil",
    defaults=[{"username": $session.get("username")}, $form])

This produces the following error:

NotFound: cannot find 'get' while searching for 'get'

If I refactor like so:

#set username = $session.get("username")
#set formUtil = $iLib.aquariumFactory("widget.FormUtil",
    defaults=[{"username": $username}, $form])

I get no errors. I get similar errors in other places ("Cannot find X while searching for X"), but I'm not clear what changed in Cheetah so that I can address it in a consistent way.
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

#5013 From: Aaron Murray <aaron@...>
Date: Wed May 22, 2013 10:53 pm
Subject: [Cheetahtemplate-discuss] Webware placeholders and the searchList
aaron@...
Send Email Send Email
 
I am upgrading to Cheetah 2.4.4. I'm getting a lot of errors relating to my $session placeholder (which is added to the searchList via a custom context object as ctx.session).

After the upgrade, $session is always None.  It seems like the Webware session variable from Servlet.py is sitting in the searchList above my custom placeholder.  The current Cheetah docs state:

"However, it is OK to put same-name variables in the searchList, because Webware does not use the searchList."

I know the docs are currently out of date.  It seems like this is no longer true.

Is there any way I can avoid changing the name of my session placeholder in every template?  I do not use Webware so I don't need any related functionality.

Thanks,
Aaron
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

#5014 From: Brian Bird <Brian.Bird@...>
Date: Thu May 23, 2013 10:18 am
Subject: Re: [Cheetahtemplate-discuss] Webware placeholders and the searchList
Brian.Bird@...
Send Email Send Email
 

I think this might be the same problem I found when I upgraded a while ago:

http://sourceforge.net/mailarchive/forum.php?thread_name=6F7F60AEAD1E0D4B9958C3B7E7D2D4E31EDA82%40STExchange01.Menai.local&forum_name=cheetahtemplate-discuss

 

Since 2.0 Cheetah seems to look at the Template instance variables before searching the namespace. Most of these variables are prefixed with __CHEETAH__ so it’s unlikely to be an issue. But 4 of them (request, transaction, application and session) aren’t and therefore mask the value you have in your namespace.
Like you, I don’t use WebWare, but the only solution I found was to rename my variables (eg. in your case call it $session2 instead of $session)
 
I have no idea why this changed, personally I think it’s a bug but I don’t know if anyone else agrees or whether anyone is maintaining Cheetah any more in any case?
 

 

From: Aaron Murray [mailto:aaron@...]
Sent: 22 May 2013 23:54
To: cheetahtemplate-discuss@...
Subject: [Cheetahtemplate-discuss] Webware placeholders and the searchList

 

I am upgrading to Cheetah 2.4.4. I'm getting a lot of errors relating to my $session placeholder (which is added to the searchList via a custom context object as ctx.session).

 

After the upgrade, $session is always None.  It seems like the Webware session variable from Servlet.py is sitting in the searchList above my custom placeholder.  The current Cheetah docs state:

 

"However, it is OK to put same-name variables in the searchList, because Webware does not use the searchList."

 

I know the docs are currently out of date.  It seems like this is no longer true.

 

Is there any way I can avoid changing the name of my session placeholder in every template?  I do not use Webware so I don't need any related functionality.

 

Thanks,

Aaron

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

Messages 5005 - 5014 of 5014   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help