Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bconstantin committed Nov 5, 2010
1 parent f78b27d commit 748d10d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DOCS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ All models inheriting from your polymorphic models will be polymorphic as well.
Create some objects
-------------------

>>> Project.objects.create(topic="Office Meeting")
>>> Project.objects.create(topic="Department Party")
>>> ArtProject.objects.create(topic="Painting with Tim", artist="T. Turner")
>>> ResearchProject.objects.create(topic="Swallow Aerodynamics", supervisor="Dr. Winter")

Get polymorphic query results
-----------------------------

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

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ If we want to retrieve all our projects, we do:

Using django_polymorphic, we simply get what we stored::

[ <Project: id 1, topic "Weekly Office Meeting">,
[ <Project: id 1, topic "Department Party">,
<ArtProject: id 2, topic "Painting with Tim", artist "T. Turner">,
<ResearchProject: id 3, topic "Swallow Aerodynamics", supervisor "Dr. Winter"> ]

Using vanilla Django, we get incomplete objects, which is probably not what we wanted::

[ <Project: id 1, topic "Weekly Office Meeting">,
[ <Project: id 1, topic "Department Party">,
<Project: id 2, topic "Painting with Tim">,
<Project: id 3, topic "Swallow Aerodynamics"> ]

Expand Down

0 comments on commit 748d10d

Please sign in to comment.