fix_request_path_info
Bert Constantin 2010-11-05 22:24:07 +01:00
parent f78b27dc1a
commit 748d10d2d5
2 changed files with 4 additions and 4 deletions

View File

@ -37,7 +37,7 @@ All models inheriting from your polymorphic models will be polymorphic as well.
Create some objects 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") >>> ArtProject.objects.create(topic="Painting with Tim", artist="T. Turner")
>>> ResearchProject.objects.create(topic="Swallow Aerodynamics", supervisor="Dr. Winter") >>> ResearchProject.objects.create(topic="Swallow Aerodynamics", supervisor="Dr. Winter")
@ -45,7 +45,7 @@ Get polymorphic query results
----------------------------- -----------------------------
>>> Project.objects.all() >>> 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">, <ArtProject: id 2, topic "Painting with Tim", artist "T. Turner">,
<ResearchProject: id 3, topic "Swallow Aerodynamics", supervisor "Dr. Winter"> ] <ResearchProject: id 3, topic "Swallow Aerodynamics", supervisor "Dr. Winter"> ]

View File

@ -42,13 +42,13 @@ If we want to retrieve all our projects, we do:
Using django_polymorphic, we simply get what we stored:: 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">, <ArtProject: id 2, topic "Painting with Tim", artist "T. Turner">,
<ResearchProject: id 3, topic "Swallow Aerodynamics", supervisor "Dr. Winter"> ] <ResearchProject: id 3, topic "Swallow Aerodynamics", supervisor "Dr. Winter"> ]
Using vanilla Django, we get incomplete objects, which is probably not what we wanted:: 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 2, topic "Painting with Tim">,
<Project: id 3, topic "Swallow Aerodynamics"> ] <Project: id 3, topic "Swallow Aerodynamics"> ]