I am working on a django-nonrel project running on Google AppEngine. I want to create a model for a game that contains details that are usually common to all sports - for example, game time, status, location, etc. Then I modeled specific classes for GameBasketball, GameBaseball, etc., And they inherit from the base class.
This creates a problem, however, if I want to get something like all games on a specific day:
Game.objects.filter(gametime=mydate)
This will return an error:
DatabaseError: Multi-table inheritance is not supported by non-relational DBs.
I understand that AppEngine does not support JOINs, and therefore it makes sense that this fails. But I'm not sure how to properly solve this problem in a non-relational environment. One of the solutions I tried was to turn Game into an abstract base class, and although this allows me to model the data in a good way, it still does not resolve the use case above, since it is impossible to get objects for an abstract base class.
Is this the only solution for placing all the data for all possible sports (and just leaving the fields that are not related to a particular sport) in the Game model, or is there a more elegant way to solve this problem?
EDIT: I'm more interested in understanding the correct way to handle this type of problem in any noSQL setup, and not in AppEngine. So feel free to answer, even if your answer is not specific to GAE!
source share