Re: Model Inheritance Downcasting

2011-11-16 Thread Torsten Bronger
Hallöchen! Bastian Kuberek writes: > [...] > > What I need is to be able to query the Widget class and get back > subclasses based on their type: > widgets = Widget.objects.all() print widgets > [ 5>,] We do this very reliably with http://djangosnippets.org/snippets/2091/ but I fin

Re: Model Inheritance Downcasting

2011-11-16 Thread Tom Evans
On Wed, Nov 16, 2011 at 4:43 PM, Bastian Kuberek wrote: > Hi, > I have looked a lot and have not yet figured out how to accomplish this. > Let me show with an example what I am trying to accomplish. > > http://code.google.com/p/django-polymorphic-models/ Cheers Tom -- You received this messa

Model Inheritance Downcasting

2011-11-16 Thread Bastian Kuberek
Hi, I have looked a lot and have not yet figured out how to accomplish this. Let me show with an example what I am trying to accomplish. class WidgetType(models.Model): """WidgetType categorizes the type of Widget""" name = models.CharField(max_length=255) slug = models.SlugField(m