On Fri, Jul 23, 2010 at 4:56 PM, maxi <maxiroba...@gmail.com> wrote: > > > On 23 jul, 18:42, Alex Gaynor <alex.gay...@gmail.com> wrote: >> On Fri, Jul 23, 2010 at 4:30 PM, maxi <maxiroba...@gmail.com> wrote: >> > Hi, >> >> > I'm working on django-firebird project and doing some modifications >> > for work with django 1.2 >> > Right now, I'm trying to pass some tests running the tests suit of >> > django trunk code and I found the next problem: >> >> > django is trying to execute this sql: >> >> > SELECT "AGGREGATION_BOOK"."PRICE", COUNT("AGGREGATION_BOOK"."PRICE") >> > AS "COUNT" >> > FROM "AGGREGATION_BOOK" >> > GROUP BY "AGGREGATION_BOOK"."PRICE" >> > ORDER BY count DESC, "AGGREGATION_BOOK"."PRICE" ASC >> >> > But, I get the next error: >> >> > DatabaseError: (-104, 'isc_dsql_prepare: \n Dynamic SQL Error\n SQL >> > error code = -104\n Token unknown - line 1, column 157\n DESC -- >> > SELECT "AGGREGATION_BOOK"."PRICE", COUNT("AGGREGATION_BOOK"."PRICE") >> > AS "COUNT" FROM "AGGREGATION_BOOK" GROUP BY "AGGREGATION_BOOK"."PRICE" >> > ORDER BY count DESC, "AGGREGATION_BOOK"."PRICE" ASC') >> >> > The problem is with the count field on ORDER BY clause. The sql is >> > defined as COUNT("AGGREGATION_BOOK"."PRICE") AS "COUNT" and the >> > count field is upper case (and quoted) then the order by clause must >> > be: >> >> > ORDER BY "COUNT" DESC >> >> > Which method can I override to solve this? >> > Any help? >> >> > Thanks in advance. >> > ---- >> > Maxi. >> >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "Django developers" group. >> > To post to this group, send email to django-develop...@googlegroups.com. >> > To unsubscribe from this group, send email to >> > django-developers+unsubscr...@googlegroups.com. >> > For more options, visit this group >> > athttp://groups.google.com/group/django-developers?hl=en. >> >> It comes from >> here:http://code.djangoproject.com/browser/django/trunk/django/db/models/s... >> in get_ordering() on the compiler. >> >> Wherever the logic is that you're uppercasing everything you'll need >> to apply it here as well. >> > > Hi Alex, > Thanks for response. > > Do you think what SQLCompiler.as_sql is the right place for to do > this ? > > Regards. > > > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To post to this group, send email to django-develop...@googlegroups.com. > To unsubscribe from this group, send email to > django-developers+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-developers?hl=en. > >
as_sql() seems like a poor place for it, because whatevers returned to you is already a string, you have no idea what type it us, unless in firebird all identifiers should be blindly uppercased. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." -- Voltaire "The people's good is the highest law." -- Cicero "Code can always be simpler than you think, but never as simple as you want" -- Me -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.