removed __getattribute__ hack from PolymorphicModel.
A somewhat cleaner solution is now used (through __init__) which also completely removes the performance impact of __getattribute__.
This commit is contained in:
@@ -23,19 +23,18 @@ class Command(NoArgsCommand):
|
||||
print 'polycmd - sqlite test db is stored in:',settings.SQLITE_DB_PATH
|
||||
print
|
||||
|
||||
"""
|
||||
ModelA.objects.all().delete()
|
||||
o=ModelA.objects.create(field1='A1')
|
||||
o=ModelB.objects.create(field1='B1', field2='B2')
|
||||
o=ModelC.objects.create(field1='C1', field2='C2', field3='C3')
|
||||
print ModelA.objects.all()
|
||||
print
|
||||
"""
|
||||
|
||||
Project.objects.all().delete()
|
||||
o=Project.objects.create(topic="John's gathering")
|
||||
o=ArtProject.objects.create(topic="Sculpting with Tim", artist="T. Turner")
|
||||
o=ResearchProject.objects.create(topic="Swallow Aerodynamics", supervisor="Dr. Winter")
|
||||
a=Project.objects.create(topic="John's gathering")
|
||||
b=ArtProject.objects.create(topic="Sculpting with Tim", artist="T. Turner")
|
||||
c=ResearchProject.objects.create(topic="Swallow Aerodynamics", supervisor="Dr. Winter")
|
||||
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
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user