This is what I have right now for simple 'tag1 OR tag2' cases. But how
do you efficiently retrieve items for 'tag1 AND (tag2 OR tag3) AND NOT
tag4' with this model?

On Jan 27, 12:59 am, Seronja <[email protected]> wrote:
> Here's where old good relational databases theory comes in.
>
> How will I do it:
> Create a model ``Tags'':
> class Tags(db.Model):
>   tag_name = db.StringProperty()
> Create a model ``Items'':
> class Items(db.Model):
>   item_name = db.StringProperty()
> And create a model  ``ItemTags''
> class ItemTags(db.model):
>   tag = db.ReferenceProperty(Tags)
>   item = db.ReferenceProperty(Items)
>
> So when you need to get items for some tags you first query the
> ``ItemTags'' for items with concrete tag(s) thgan by key you get
> Items.
>
> Cheers,
> Serhiy
>
> On Jan 24, 3:17 am, George Sudarkoff <[email protected]> wrote:
>
> > I have a bit of a problem coming up with an efficient data model/algo
> > for a project I am working on:
>
> > I have a few hundred items, each tagged with zero or more tags. I need
> > to be able to fetch items that, for example, are tagged with tag1 AND
> > (tag2 OR tag3) AND NOT tag4.
>
> > Any help would be greatly appreciated!



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to