Re: Custom manager for many-to-many traversal

2008-09-03 Thread MrJogo
m/group/django-users/browse_thread/thread/9be1 > >> ... > > >> There's a lot of cruft in that thread, the basic idea is using > >> cursor.execute() to do your subqueries (selecting all living authors > >> per book), and then using pure python to attach those subqu

Re: Custom manager for many-to-many traversal

2008-09-01 Thread Eric Abrahamsen
ython to attach those subqueries to >> your larger book queryset. It's not as painful as it sounds. >> >> Lastly, there are rumors of aggregation support coming soon/already >> here, but I'm not sure how that works (or even if it will solve these >> kinds of problems)

Re: Custom manager for many-to-many traversal

2008-09-01 Thread MrJogo
f problems) so will say no more... > > E > > > > > On Aug 26, 2:10 am, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > >> On Aug 25, 2008, at 3:11 PM,MrJogowrote: > > >>> How do I create a custom manager for many-to-many traversal? An > >>&

Re: Custom manager for many-to-many traversal

2008-08-26 Thread Eric Abrahamsen
ll solve these kinds of problems) so will say no more... E > > > On Aug 26, 2:10 am, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: >> On Aug 25, 2008, at 3:11 PM,MrJogowrote: >> >> >> >> >> >>> How do I create a custom manager for many-to

Re: Custom manager for many-to-many traversal

2008-08-26 Thread MrJogo
many levels (ie, only books with living authors AND only the related living authors) with one command/db hit. On Aug 26, 2:10 am, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > On Aug 25, 2008, at 3:11 PM,MrJogowrote: > > > > > > > How do I create a custom man

Re: Custom manager for many-to-many traversal

2008-08-25 Thread Eric Abrahamsen
On Aug 25, 2008, at 3:11 PM, MrJogo wrote: > > How do I create a custom manager for many-to-many traversal? An > example will illustrate what I want to do better. Suppose I have the > following models.py: > > class Book(models.Model): > title = models.CharField(max_length=

Re: Custom manager for many-to-many traversal

2008-08-25 Thread MrJogo
gt; On Aug 25, 12:11 am,MrJogo<[EMAIL PROTECTED]> wrote: > > > How do I create a custom manager for many-to-many traversal? An > > example will illustrate what I want to do better. Suppose I have the > > following models.py: > > > class Book(models.Model): &

Re: Custom manager for many-to-many traversal

2008-08-25 Thread John M
o I create a custom manager for many-to-many traversal? An > example will illustrate what I want to do better. Suppose I have the > following models.py: > > class Book(models.Model): >   title = models.CharField(max_length=100) > > class Author(models.Model): >   books = models.F

Custom manager for many-to-many traversal

2008-08-25 Thread MrJogo
How do I create a custom manager for many-to-many traversal? An example will illustrate what I want to do better. Suppose I have the following models.py: class Book(models.Model): title = models.CharField(max_length=100) class Author(models.Model): books = models.ForeignKey(Book) name