limeuser / appengine-ndb-experiment

Automatically exported from code.google.com/p/appengine-ndb-experiment
Other
0 stars 0 forks source link

polymodel gql bug #199

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
(See also http://code.google.com/p/googleappengine/issues/detail?id=1075; in 
db, different things fail.)

The following fails:

class A(PolyModel): pass
class B(A): pass
class C(A): pass
B().put()
C().put()

B.gql('').fetch() --> expect [B()], but actually returns [B(), C()].

What works: A.gql("WHERE class = 'B'").fetch() --> [B()]. PolyModel should 
override gql() to add this clause.

Also fails: gql('SELECT * FROM B') -- raises BadQueryError. Probably this is 
okay. (Although why not KindError?)

Original issue reported on code.google.com by guido@google.com on 16 Aug 2012 at 12:41

GoogleCodeExporter commented 9 years ago
Actually, 'SELECT * FROM B' should also be made to work. This is going to be 
more work, but since we already look up the class it should in principle be 
possible.

PS. For the KindError, see issue 200.

Original comment by guido@google.com on 16 Aug 2012 at 3:30

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 36e11019da9a.

Original comment by guido@google.com on 16 Aug 2012 at 8:59