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 <sudark...@gmail.com> 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 google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to