It's an error in the sense that I know that any code that tries to use
certain back links, a.b_set in this example, is wrong according to
what I know about my schema.

Since I don't define b_set in A if I want back links, I'd really
rather not say that I don't want b_set in A if I don't want it,
especially if the way I say it looks a lot like a definition of b_set.

I suppose that I could make my own version of db.Reference property
that create a random name for unwanted backlinks.

On Oct 10, 11:51 pm, Ross Ridge <[EMAIL PROTECTED]> wrote:
> 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 google-appengine@googlegroups.com
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