From: scott lewis <sco...@gmail.com>
Date: Thu, 17 Apr 2008 16:34:01 -0600
Local: Fri, Apr 18 2008 8:34 am
Subject: Re: Feel free to test queryset-refactor branch
On 2008-04-17, at 1553, Justin Fagnani wrote: > Hey Malcolm, This is a dirty hack, but it came in handy for me... > I've been using qs-rf for a while now with basically no problems. > There's one thing that may a little odd that I stumbled on while > The first thing is that there seems to be no way to tell if an > Is there a better way to do this, or is this something that could be > The odd part is what happens with the child reference. parent.child > I haven't actually encountered this in any real life situation, > One additional thing is that in one case, I know which subclasses > Parent.objects.all().select_subclasses('Child1','Child2') If you add this method to your parent class: def canonical(self): You can then convert a queryset to a list of child classes: child_classes = [c.canonical() for c in Parent.objects.all()] Basically, canonical() tries to grab a list of descendant classes, scott. You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||