This allows all the fruit in the database to be returned as the specialized fruit model instances rather than general Fruit model instances. We hope this functionality will allow the grouping of content types with common fields and allow rapid access to the specific model instances so that list views can be easily built which reflect the diversity of specialized content.
djeneralize handles all the database lookups that you would need to perform behind the scenes and allows the vast majority of Django query syntax to be used. It supports multiple-levels of specialization to allow querying of sub-generalizations.
We are planning on integrating this work into a current project to allow fine-grained categorization of all content on the 2degrees platform and hope this will offer us all the power and flexibility we need.
To get djeneralize either clone the source from github, or install it via easy_install:
$ easy_install djeneralizeFurther information and full documentation is also available.

So this is what SQLAlchemy's `with_polymorphic` does.
ReplyDeletehttp://www.sqlalchemy.org/docs/05/mappers.html#mapping-class-inheritance-hierarchies
This is similar to django_polymorphic: http://bserve.webhop.org/wiki/django_polymorphic
ReplyDeleteI love using this kind of design in apps. We had a similar implementation for an app we were building and it just makes thing so easy to maintain.
ReplyDelete