2
I believe what you suggested is called Entity-attribute-value
model
http://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model
I think there could be a good argument for keeping all data belonging to your events defined inside of a model instead of through a related generic EAV table.
To do this you could use one of djangoβs polymorphic libraries. I have used django-model-utilsβ InheritanceManager in production. There are quite a few libraries including django-polymorphic.
Taking an inhertance based approach you might define a single Event
model or Sport
model. A sport might have a name, league, etc. All Event
s might have a start date and end date and sport.
Using this approach you can defined foriegn keys from your registrations to the base Event
class and use djangos built in ORM to select all events or registrations of certain types, without having the additional application logic/object inspection/ property inspection of taking an EAV approach!
0
You can store all additional data in Text field using JSON object or other serializer.
Take look at django-jsonfield
- [Answered ]-Checkbox not working in a Django form (bug?)
- [Answered ]-Replicating Django User Passwords