Go to file
Bert Constantin d8cdfb02ff minor test case fix: MROBase1 2010-01-28 22:34:14 +01:00
poly minor test case fix: MROBase1 2010-01-28 22:34:14 +01:00
.gitignore updated docs 2010-01-28 20:39:07 +01:00
AUTHORS updated docs, and moved them to DOCS.rst and README.rst 2010-01-26 14:28:22 +01:00
DOCS.rst updated docs 2010-01-28 20:39:07 +01:00
LICENSE updated docs, and moved them to DOCS.rst and README.rst 2010-01-26 14:28:22 +01:00
README.rst updated docs 2010-01-28 20:39:07 +01:00
__init__.py initial commit 2010-01-15 21:13:36 +01:00
manage.py manage.py: prepend ./libraries-local to sys.path, allowing us to test any version of Django (after being copied there) 2010-01-24 16:24:10 +01:00
settings.py IMPORTANT: DB schema changed: Django's ContentType is now used 2010-01-26 22:31:56 +01:00

README.rst

**2010-1-26**
	IMPORTANT - database schema change (more info in change log).
	I hope I got this change in early enough before anyone started to use
	polymorphic.py in earnest. Sorry for any inconvenience.
	This should be the final DB schema now.


Usage, Examples, Installation & Documentation, Links
----------------------------------------------------

* Documentation_ and Overview_  
* `Discussion, Questions, Suggestions`_
* GitHub_ - Bitbucket_ - `Download as TGZ`_ or ZIP_ 

.. _Documentation: http://bserve.webhop.org/wiki/django_polymorphic/doc 
.. _Discussion, Questions, Suggestions: http://django-polymorphic.blogspot.com/2010/01/messages.html
.. _GitHub: http://github.com/bconstantin/django_polymorphic
.. _Bitbucket: http://bitbucket.org/bconstantin/django_polymorphic
.. _Download as TGZ: http://github.com/bconstantin/django_polymorphic/tarball/master
.. _ZIP: http://github.com/bconstantin/django_polymorphic/zipball/master
.. _Overview: http://bserve.webhop.org/wiki/django_polymorphic


What is django_polymorphic good for?
------------------------------------

If ``ArtProject`` and ``ResearchProject`` inherit from the model ``Project``:

>>> Project.objects.all()
.
[ <Project:         id 1, topic: "John's Gathering">,
  <ArtProject:      id 2, topic: "Sculpting with Tim", artist: "T. Turner">,
  <ResearchProject: id 3, topic: "Swallow Aerodynamics", supervisor: "Dr. Winter"> ]

In general, objects retrieved from the database are always returned back 
with the same type/class and fields they were created and saved with.
It doesn't matter how these objects are retrieved: be it through the
model's own managers/querysets, ForeignKeys, ManyToManyFields
or OneToOneFields.

The resulting querysets are polymorphic, i.e they may deliver
objects of several different types in a single query result.

``django_polymorphic`` consists of just one add-on module, ``polymorphic.py``,
that adds this functionality to Django's model inheritance system
(for models that request this behaviour).


Status
------

This module is still very experimental. Please see the docs for current restrictions,
caveats, and performance implications.