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 other objects before using them.
Best Regards, Jesaja Everling On Tue, Nov 25, 2008 at 9:22 AM, p0windah <[EMAIL PROTECTED]> wrote: > > I am using Djang0 1.0 with appengine and have bumped up against an odd > thing. > > The order in which models are declared makes a difference. > > Using the models.py you will get the following error: > NameError: name 'Foo' is not defined > > While swapping Foo with Bar solves this problem, it is not a practical > solution when you have numerous models and references scattered across > them. > > So, how are others tackling this problem? > > #/project/myapp/models.py – this does not work > class Bar(db.Model): > fluff = db.ReferenceProperty(Foo) > > class Foo(db.Model): > title = db.StringProperty() > > > > > -- o L_/ OL This is Schäuble. Copy Schäuble into your signature to help him on his way to Überwachungsstaat. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
