guettli
2014-05-13 18:52:58 UTC
I search for a way to get polymorphic inheritance like in "Single table
inheritance" [1]
I have found this comparison site:
https://www.djangopackages.com/grids/g/model-inheritance/
Before I try each, I want to ask here, if someone answer some questions:
I have three classes: Parent, ChildA, ChildB.
The result of Parent.objects.filter() should return Child instances and
should query only one db table.
Unfortunately one one app has filed the column "amount of queries" in the
comparison grid.
What about the other apps?
Next question:
If the class Parent is in the parentapp application, and I want to subclass
this model in a different
application (childapp). The table which belongs to parentapp needs to be
changed: new columns
need to be added. Does south handle the migrations like in the build in
(django core) inheritance solutions?
Why not the build in inheritance solutions? My point of view: multi table
inheritance is slow and with abstract base classes
you can't query the base class. Both solutions are not polymorphic.
[1] http://en.wikipedia.org/wiki/Single_Table_Inheritance
inheritance" [1]
I have found this comparison site:
https://www.djangopackages.com/grids/g/model-inheritance/
Before I try each, I want to ask here, if someone answer some questions:
I have three classes: Parent, ChildA, ChildB.
The result of Parent.objects.filter() should return Child instances and
should query only one db table.
Unfortunately one one app has filed the column "amount of queries" in the
comparison grid.
What about the other apps?
Next question:
If the class Parent is in the parentapp application, and I want to subclass
this model in a different
application (childapp). The table which belongs to parentapp needs to be
changed: new columns
need to be added. Does south handle the migrations like in the build in
(django core) inheritance solutions?
Why not the build in inheritance solutions? My point of view: multi table
inheritance is slow and with abstract base classes
you can't query the base class. Both solutions are not polymorphic.
[1] http://en.wikipedia.org/wiki/Single_Table_Inheritance
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e1f72be5-e4ec-4e92-a6ca-30507a9bab28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e1f72be5-e4ec-4e92-a6ca-30507a9bab28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.