Hi,

My application has a model that just contains two db.ReferenceProperty
fields pointing to the same model type. I want to be able to test the
existence of an entry in the data store for a given pair. In my app I
couldn't get it working so I tried this in the local development
console:

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

class B(db.Model):
  alpha = db.ReferenceProperty(A, collection_name='alpha')
  beta = db.ReferenceProperty(A, collection_name='beta')

a1 = A(name='one')
a1.put()
a2 = A(name='two')
a2.put()

b = B(alpha=a1, beta=a2)
b.put()

q = B.all().filter('alpha=', a1).filter('beta=', a2)
print q.count()

It prints out "0" instead of the "1" I'd expect. Any ideas why?

Ian

--~--~---------~--~----~------------~-------~--~----~
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