anthony-tresontani/django-subclass
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
django_subclass If a subclass S1 of the base class B is created: django_subclass allow to perform B.objects.all() and to retrieve object of type S1 If a proxy P1 of the base class B is created: django_subclass allow to perform B.object.get() retrieve an object of type S1 Usage: 1 - Add the django_subclass folder to your PYTHON_PATH and installed_apps 2 - Register your model: site.register(SubClassA) 3 - That's it Before : >>> A = SubClassA(key=1) >>> BaseClass.objects.get(key=1).__class__ <class 'test_app.models.BaseClass'> After : >>> A = SubClassA(key=1) >>> BaseClass.objects.get(key=1).__class__ <class 'test_app.models.SubClassA'>
About
Extend the django subclass system. For proxy class, allow to retrieve the object with the proxy class (not the base class). On subclass, enable to retrieve objects through the base class with their real types
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published