Re: order_by not working with foreign keys:

2007-02-02 Thread Ramiro Morales
Hi Michael, On 2/2/07, Michael Radziej <[EMAIL PROTECTED]> wrote: > > Hi Ramiro, > > are you the Mr. Anonymous who left comment #18? Just for > clarification that I understand who is who ;-) > No I'm not :), it seems to me Mr Anonymous is Bram Dejong. I attached the updated patch to ticket #2076

Re: order_by not working with foreign keys:

2007-02-02 Thread Michael Radziej
Hi Ramiro, are you the Mr. Anonymous who left comment #18? Just for clarification that I understand who is who ;-) Michael -- noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg - Tel +49-911-9352-0 - Fax +49-911-9352-100 http://www.noris.de - The IT-Outsourcing Company --~--~---

Re: order_by not working with foreign keys:

2007-02-02 Thread Ramiro Morales
On 2/1/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On 2/1/07, Michael Radziej <[EMAIL PROTECTED]> wrote: > > > is there a > > > HOWTO somewhere on how to write a test which does the whole model, > > > database sync, etc etc cycle? > > [...] > > [...] > > Django's internal tests are in t

Re: order_by not working with foreign keys:

2007-02-01 Thread Russell Keith-Magee
On 2/1/07, Michael Radziej <[EMAIL PROTECTED]> wrote: > > is there a > > HOWTO somewhere on how to write a test which does the whole model, > > database sync, etc etc cycle? > > http://www.djangoproject.com/documentation/testing/ > > explains how tests and fixtures work. Look for an existing test

Re: order_by not working with foreign keys:

2007-02-01 Thread Michael Radziej
Bram - Smartelectronix: > Michael Radziej wrote: >> Bram - Smartelectronix: >> >> >>> I'll be updating the ticket, but I was wondering when the ticket would >>> be merged with trunk. >> Someone needs to writes tests for this. As soon as this has been >> done, the ticket can be promoted to "ready

Re: order_by not working with foreign keys:

2007-02-01 Thread Bram - Smartelectronix
Michael Radziej wrote: > Bram - Smartelectronix: > > >> I'll be updating the ticket, but I was wondering when the ticket would >> be merged with trunk. > > Someone needs to writes tests for this. As soon as this has been > done, the ticket can be promoted to "ready for checkin", which means >

Re: order_by not working with foreign keys:

2007-02-01 Thread Michael Radziej
Bram - Smartelectronix: > I'll be updating the ticket, but I was wondering when the ticket would > be merged with trunk. Someone needs to writes tests for this. As soon as this has been done, the ticket can be promoted to "ready for checkin", which means added core developer attention ;-) Mic

Re: order_by not working with foreign keys:

2007-02-01 Thread Bram - Smartelectronix
Michael Radziej wrote: > Hi, > > there's a ticket with a patch about the order_by-Problem: > > http://code.djangoproject.com/ticket/2210. > > Does it help? I just figured out that this problem also exists, even if the name ISN'T different: class Book(models.Model): title = models.Tex

Re: order_by not working with foreign keys:

2007-01-26 Thread Bram - Smartelectronix
Michael Radziej wrote: > Please report your results in the ticket, I'd appreciate! Done. - bram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us

Re: order_by not working with foreign keys:

2007-01-25 Thread Michael Radziej
Bram - Smartelectronix: > Michael Radziej wrote: >> Hi, >> >> there's a ticket with a patch about the order_by-Problem: >> >> http://code.djangoproject.com/ticket/2210. >> >> Does it help? > > Knowing it's broken helps a LOT :-) > I'll try to see if it works w/ the patch. Please report your resu

Re: order_by not working with foreign keys:

2007-01-25 Thread Bram - Smartelectronix
Michael Radziej wrote: > Hi, > > there's a ticket with a patch about the order_by-Problem: > > http://code.djangoproject.com/ticket/2210. > > Does it help? Knowing it's broken helps a LOT :-) I'll try to see if it works w/ the patch. Thanks Michael, - bram --~--~-~--~~---

Re: order_by not working with foreign keys:

2007-01-25 Thread Michael Radziej
Hi, there's a ticket with a patch about the order_by-Problem: http://code.djangoproject.com/ticket/2210. Does it help? Michael -- noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg - Tel +49-911-9352-0 - Fax +49-911-9352-100 http://www.noris.de - The IT-Outsourcing Company --~

Re: order_by not working with foreign keys:

2007-01-25 Thread Bram - Smartelectronix
Waylan Limberg wrote: > Actually, as you have `related_name` set (to 'stats'), I believe this > may be what you want: > > Book.objects.all().select_related().order_by('-stats__avg_rating')[0:10] OK, as this failed as well, I made a clean example, from ZERO, and tried it. Any ideas why this woul

Re: order_by not working with foreign keys:

2007-01-24 Thread Waylan Limberg
On 1/24/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > > Waylan Limberg wrote: > > On 1/24/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > >> Book.objects.all().select_related() > >> .order_by('-bookshop_bookstat.avg_rating')[0:10] > >> > > > > You should replace the

Re: order_by not working with foreign keys:

2007-01-24 Thread Bram - Smartelectronix
Waylan Limberg wrote: > On 1/24/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: >> Book.objects.all().select_related() >> .order_by('-bookshop_bookstat.avg_rating')[0:10] >> > > You should replace the dot (.) with a double underscore (__), so: > > .order_by('-book

Re: order_by not working with foreign keys:

2007-01-24 Thread Waylan Limberg
On 1/24/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > > Book.objects.all().select_related() > .order_by('-bookshop_bookstat.avg_rating')[0:10] > You should replace the dot (.) with a double underscore (__), so: .order_by('-bookshop_bookstat__avg_rating')[0:10]

Re: order_by not working with foreign keys:

2007-01-24 Thread Bram - Smartelectronix
Honza Král wrote: >> - >> class Book(models.Model): >> >> >> class BookStat(models.Model): >> book = models.OneToOneField(Song, related_name='stats') >> avg_rating = models.FloatField(max_digits=2, decimal_places=1

Re: order_by not working with foreign keys:

2007-01-24 Thread Honza Král
On 1/24/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > > Honza Kr�l wrote: > > it occured before on the mailing list... > > > > if you add select_related(), it will work... > > > > the problem is that specifying ordering like this doesn't force the > > join in the query so you might end up

Re: order_by not working with foreign keys:

2007-01-24 Thread Bram - Smartelectronix
Honza Král wrote: > it occured before on the mailing list... > > if you add select_related(), it will work... > > the problem is that specifying ordering like this doesn't force the > join in the query so you might end up with a query that sorts on > something that just isn't there... That didn

Re: order_by not working with foreign keys:

2007-01-23 Thread Honza Král
it occured before on the mailing list... if you add select_related(), it will work... the problem is that specifying ordering like this doesn't force the join in the query so you might end up with a query that sorts on something that just isn't there... On 1/23/07, Bram - Smartelectronix <[EMAIL

order_by not working with foreign keys:

2007-01-23 Thread Bram - Smartelectronix
Hello Everyone, Trying this: Book.objects.all().order_by('-app_statistics.avg_rating') I get: ProgrammingError at /bleep/ ERROR: missing FROM-clause entry for table "app_statistics" at character 375 Anyone know what the problem is? (working with trunk, upd