Hey all,

I decided to play with app engine and got stuck on this problem.
I have two entities List and ListItem. What I need to do is to
associate many ListItems with a List however i cannot simply
use db.ReferenceProperty in ListItem class because each ListItem can
be part of multiple Lists. I figured that we can use
db.ListProperty(db.key) in List class to keep multiple list items but
is this
efficient if each list would have about 100-200 items? However last
method,
cannot be used in my case becuase I need
priority value for each ListItem and priority of ListItem might differ
between different Lists for same ListItem so approach with
ListProperty(db.key) doesnt work. I ended with this:


class List(db.Model):
    name = db.StringProperty()

class ListToListItem(db.Model):
    list = db.ReferenceProperty(List)
    item = db.ReferenceProperty(ListItem)
    priority = db.Int...

class ListItem(db.Model):
    name = db.StringProperty()


Am I doing this right or there is a better/efficient way?

Thank you in advance,
Dmitriy

--

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