extra(): Re-implemented. Now is polymorphic (nearly) without restrictions.
Added test cases + docs.
This commit is contained in:
@@ -30,11 +30,10 @@ class Command(NoArgsCommand):
|
||||
print Project.objects.all()
|
||||
print
|
||||
|
||||
"""
|
||||
ModelA.objects.all().delete()
|
||||
a=ModelA.objects.create(field1='A1')
|
||||
b=ModelB.objects.create(field1='B1', field2='B2')
|
||||
c=ModelC.objects.create(field1='C1', field2='C2', field3='C3')
|
||||
print ModelA.objects.all()
|
||||
print
|
||||
"""
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ class ArtProject(Project):
|
||||
class ResearchProject(Project):
|
||||
supervisor = models.CharField(max_length=30)
|
||||
|
||||
class ModelA(ShowFieldType, PolymorphicModel):
|
||||
class ModelA(ShowFieldTypeAndContent, PolymorphicModel):
|
||||
field1 = models.CharField(max_length=10)
|
||||
class ModelB(ModelA):
|
||||
field2 = models.CharField(max_length=10)
|
||||
|
||||
Reference in New Issue
Block a user