On Thursday 13 July 2006 01:33, Russell Keith-Magee wrote:
> On 7/12/06, Kilian CAVALOTTI <[EMAIL PROTECTED]> wrote:
> No. Q objects do not support custom SQL - they are just wrappers that can
> be used to wrap groups of keyword search parameters (e.g.,
> article__name__contains='foo') so that they can be combined using logical
> operations.
>
> If you want custom SQL, you must use extra(), or obtain a cursor and write
> all the SQL from scratch.

Argh, bad news. Actually I asked the question because I'd like to use custom 
SQL in a 'limit_choices_to' option, in the admin interface. I can't figure 
how to proceed, since this option only takes a dictionary of lookup 
arguments, or Q objects. So I guess there's no way to use custom SQL 
in 'limit_choices_to', is it?

Regards,
-- 
Kilian CAVALOTTI                      Administrateur réseaux et systèmes
UPMC / CNRS - LIP6 (C870)
8, rue du Capitaine Scott                          Tel. : 01 44 27 88 54
75015 Paris - France                               Fax. : 01 44 27 70 00

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to