Hello,
I am creating a new directory page to list Merchandise. The /dir/
dhp.html page has these links:
<ul>
<li><b>Merchandise</b></li>
<ul>
<li><a href="/dir">Tshirts</a></li>
<li><a href="/dir">Mugs</a></li>
<li><a href="/dir">Posters</a></li>
</ul>
<li><b>Articles</b></li>
<li><b>Video</b></li>
</ul>
/dir is handled by the Directory handler which will get the relevant
merchandise type from the database and display it.
This is my model:
class Item(db.Model):
user_who_liked_this_item = db.UserProperty()
title = db.StringProperty()
url = db.StringProperty()
date = db.DateTimeProperty(auto_now_add=True)
points = db.IntegerProperty(default=1)
type = db.StringProperty()
In Directory handler I do this:
items = Item.all()
items.filter("type =", "merchandise_type")
for item in items:
# display the items...
For this to work I need to get the link text for each merchandise and
say, for instance
merchandise_type = "tshirt"
items = Item.all()
items.filter("type =", "merchandise_type")
so that Directory handler fetches the "tshirt" type from the datastore
when "tshirts" is clicked.
I know this is easy to do but I could not figure it out. Thanks for
your help.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" 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/google-appengine?hl=en.