Andy Freeman wrote:
> class A(db.Model):
> pass
>
> class B(db.Model):
> a = db.ReferenceProperty(A)
>
> In some cases, it's an error to use instances of A to refer to
> instances of B.
>
> It would be nice to have some documented way to express that fact, to
> make it so that A.get(key).b_set throws an exception.
I don't know why it would be an error or why you want to throw an
exception, but the b_set attribute is just a query. You can always
create your own query function that does whatever it is you want.
Maybe something like the following:
class A(db.Model):
def get_b_set(self):
if self.cant_refer_back_to_b:
raise Exception
return self.b_set_private
class B(db.Model):
a = db.ReferenceProperty(A, collection_name =
"b_set_private")
Ross Ridge
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---