Hi Simon, On Mar 4, 3:27 am, Simon Meers <drme...@gmail.com> wrote: > +1 for better polymorphic support in Django core; it is a very common > problem which could do with an efficient and elegant solution. > Regarding efficiency, if you can keep track of your subclasses > effectively (potentially using a registry if not introspection), you > can use select_related to retrieve heterogeneous multi-table > inheritance models in a single query (see example in [1]). I haven't > looked deeply enough into django_polymorphic to see if it includes > such optimisations. I'm sure we could further tweak the internals to > make things more efficient and developer-friendly in this regard.
FWIW, django-model-utils [1] includes an InheritanceManager that implements polymorphic queries in a single query via select_related. [1] https://github.com/carljm/django-model-utils -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.