You can do this by changing the Thing model:
http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#reverse-generic-relations
class Thing(models.Model):
...
otherthing = generic.GenericRelation(OtherThing)
For each thing, when you run thing.otherthing.all(), you'll
On Tue, Mar 10, 2009 at 11:35 AM, Chris McCormick wrote:
>
> Hi,
>
> I want to do something like:
>
> Thing.objects.all().order_by("otherthing__count")
>
> So there's a many-to-many between Thing and Otherthing, and I want to get a
> list of Things in the order of
Hi,
I want to do something like:
Thing.objects.all().order_by("otherthing__count")
So there's a many-to-many between Thing and Otherthing, and I want to get a
list of Things in the order of most-otherthings joined - is there some easy,
Djangoish way to do it, or should I create a new field in
3 matches
Mail list logo