Go to file
Bert Constantin ba9a0b1302 updated docs, and moved them to DOCS.rst and README.rst 2010-01-26 14:28:22 +01:00
poly updated docs, and moved them to DOCS.rst and README.rst 2010-01-26 14:28:22 +01:00
.gitignore 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
AUTHORS updated docs, and moved them to DOCS.rst and README.rst 2010-01-26 14:28:22 +01:00
DOCS.rst updated docs, and moved them to DOCS.rst and README.rst 2010-01-26 14:28:22 +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, and moved them to DOCS.rst and README.rst 2010-01-26 14:28:22 +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 move test db to /var/tmp/ 2010-01-25 16:47:28 +01:00

README.rst

===============================
Fully Polymorphic Django Models
===============================


What it Does
============

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 delivered just as
they were created and saved, with the same type/class and fields. It doesn't
matter how you access these objects: be it through the model's own
managers/querysets, ForeignKey, ManyToMany or OneToOne fields.

The resulting querysets are polymorphic, and 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 kind of automatic polymorphism to Django's model
inheritance system (for models that request this behaviour).

Please see additional examples and the documentation here:

	http://bserve.webhop.org/wiki/django_polymorphic

or in the DOCS.rst file in this repository.

Status
------

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