Wednesday, 15 June 2011

python - Can I find all of a certain base model in App Engine? -


Looking at a class-like relationship:

  Class A (DB model): Pass Class B (A): Pass  

Can I get all the base classes? Query:

  models.A.all (). Fetch (1)  

returns an empty list.

Datastore has not supported this kind of polymorphism - but you can use it to do this You can. Instead of the model, the successor from Polymodel and things will behave as much or less as you would expect.


No comments:

Post a Comment