I've hit the send button to early!
I would like to know, if the PostTag entity is necessary... Is it nog
possible to describe the relationship just in the Post and Tag model?
So that i can do Post.get_tags() or Tag.get_posts_for_tag('test') and
similar methods...
Thanks...
On Feb 23, 12:47 pm, Versluys Sander <[email protected]> wrote:
> I want to model the classic post has many tags and tags has many posts
> entities.
>
> I've read the docs about modeling
> here:http://code.google.com/intl/nl/appengine/articles/modeling.html
>
> But i would like to know how other people do this...
>
> class Post(db.Model):
> content = db.TextProperty()
>
> class Tag(db.Model):
> name = db.StringProperty()
>
> class PostTag(db.Model):
> post = db.ReferenceProperty(Post,
> required=True,
> collection_name='posts')
> tag= db.ReferenceProperty(Tag,
> required=True,
> collection_name='tags')
>
> Thanks a lot!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---