On Oct 8, 9:00 pm, Shailen <[email protected]> wrote:
>
> Option 2, use list properties:
>
> class URL(db.Model):
> url = db.StringProperty()
>
> class Tags(db.Model):
> tags = db.StringListProperty()
>
> Store a list of tags with a URL key as parent.
Why not simply add the tags to the URL entity?
class URL(db.Model):
url = db.StringProprety()
tags = db.StringListProperty()
@classmethod
def fetch_by_tag(cls, *tags):
query = URL.all()
for t in tags:
query.filter('tags =', t)
return query.fetch()
urls = URL.fetch_by_tag('foo', 'bar', 'baz')
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---