[google-appengine] Re: declaration precedence in models.py

2008-11-25 Thread Jesaja Everling
Hi p0windah! This doesn't work, because in your example you are refering to Foo when you try to create a reference to it in a variable called fluff. However, until this point Python doesn't know anything about Foo, because it is declared later. This is normal, you have to declare variables or othe

[google-appengine] Re: declaration precedence in models.py

2008-12-01 Thread djidjadji
Just don't mention the referenced class, and build the query yourself class Bar(db.Model): fluff = db.ReferenceProperty(collection_name='ref1') q=Barr.all().filter('fluff =', myfoo.key()).fetch(1000) or make this a property of Foo def Foo(): @property def bars(self): return Barr.all