Am 26.02.2011 02:56 schrieb vhiremath4:
I tried setting up a function in the root.py file in "controllers" as
follows:
@expose('honutv.templates.index')
def get_shinfo(self):
result = rdshinfo()
return result
That should work, but the expose decorator must have the same identation
as the def statement.
Also, you don't need a a function that creates a connection etc. to get
the query results. SQLAlchemy does all this for you already if you set
up a model class for your table. Read the SQLAlchemy ORM or TG docs
(e.g. http://www.turbogears.org/2.1/docs/main/movie_tutorial.html)
to learn more about this concept.
Then, you need to learn a bit Genshi to display the results in the index
template (hint: you need the py:for directive). Or you can also use a
grid widget to display a result list.
-- Christoph
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.