Re: Custom SQL in Q objects

2006-09-01 Thread bk
Thanks, Luke. I'll be working on an ajax solution, and will hopefully have something to post about it soon. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Custom SQL in Q objects

2006-08-31 Thread Luke Plant
On Thursday 31 August 2006 14:03, bk wrote: > class CategoryPhoto(models.Model): > category = models.ForeingKey(Category, edit_inline=models.Tabular) > position = models.PositiveIntegerField(core=True) > photo = models.ForeignKey(Photo, limit_choices_to={'category__pk': > ???}) > > ??? is wh

Re: Custom SQL in Q objects

2006-08-31 Thread bk
I've got a similar situaton with trying to use 'limit_choices_to' on an intermediary table, but I haven't been able to get it working... Here's a quick abbreviated example: class Category(models.Model): name = models.CharField(maxlength=200) class Photo(models.Model): name = models.CharField

Re: Custom SQL in Q objects

2006-08-30 Thread Alan Green
On 8/31/06, Jakub Labath <[EMAIL PROTECTED]> wrote: > > Hi, > > Thanks for advice Malcolm! > > I feel a sample would save some time to other people. Time that i had to > spend. > > class OnlyRealProfileSQL: > def get_sql(*args): > #select name from django_content_type where app_label

Re: Custom SQL in Q objects

2006-08-30 Thread Jakub Labath
Hi, Thanks for advice Malcolm! I feel a sample would save some time to other people. Time that i had to spend. class OnlyRealProfileSQL: def get_sql(*args): #select name from django_content_type where app_label = 'users' and model != 'profile' and model like '%p rofile' retu

Re: Custom SQL in Q objects

2006-07-13 Thread Malcolm Tredinnick
On Thu, 2006-07-13 at 21:54 +0800, Russell Keith-Magee wrote: > > > On 7/13/06, Kilian CAVALOTTI <[EMAIL PROTECTED]> wrote: > > 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 inter

Re: Custom SQL in Q objects

2006-07-13 Thread Russell Keith-Magee
On 7/13/06, Kilian CAVALOTTI <[EMAIL PROTECTED]> wrote: Argh, bad news. Actually I asked the question because I'd like to use customSQL in a 'limit_choices_to' option, in the admin interface. I can't figurehow to proceed, since this option only takes a dictionary of lookup arguments, or Q objects.

Re: Custom SQL in Q objects

2006-07-13 Thread Kilian CAVALOTTI
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 the

Re: Custom SQL in Q objects

2006-07-12 Thread Russell Keith-Magee
On 7/12/06, Kilian CAVALOTTI <[EMAIL PROTECTED]> wrote: Hi all,I'd like to know if Q objects support custom SQL queries, as used in extra()function?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__co