Re: Queryset Filters

2014-04-08 Thread Jill Green
Thank you for the response. I feared the answered would be no but I wanted to be sure. Sent from my iPhone On Apr 9, 2014, at 12:27 AM, Anssi Kääriäinen wrote: > No, there is no way to do what you want. All filters are implemented as > filters in the DB, Django doesn't know how to execute th

Re: Queryset Filters

2014-04-08 Thread Anssi Kääriäinen
No, there is no way to do what you want. All filters are implemented as filters in the DB, Django doesn't know how to execute them in Python. There was some effort to implement filters also in Python, but there hasn't been any activity on this recently. The only way to do this currently is to i

Queryset Filters

2014-04-08 Thread Jill Green
I apologize if this question has already been asked and answered. I want to know if it's possible to filter out query sets without doing lazy queries or hitting the database again. Basically I have this query: qs= self.filter(a months worth of data) Now if I evaluate this query by doing this:

Re: QuerySet filters. Making both sides of the comparison parametric

2007-09-24 Thread AndyB
Lovely. I'd never seen the function(**{expression}) syntax before. For anyone else in the same boat the rather terse official explanation is here: http://docs.python.org/ref/calls.html (search the page for '**expression') Tim Chase wrote: > > if (search_query['organisation']!=""): > >

Re: QuerySet filters. Making both sides of the comparison parametric

2007-09-24 Thread Tim Chase
> if (search_query['organisation']!=""): > jobs = jobs.filter(organisation=search_query['organisation']) > if (search_query['region']!=""): > jobs = jobs.filter(region=search_query['region']) > if (search_query['category']!=""): > jobs = jobs.filter(category=sea

QuerySet filters. Making both sides of the comparison parametric

2007-09-24 Thread AndyB
So if I've got code like this: if (search_query['organisation']!=""): jobs = jobs.filter(organisation=search_query['organisation']) if (search_query['region']!=""): jobs = jobs.filter(region=search_query['region']) if (search_query['category']!=""): jobs = jobs

Re: Parent / Child Categories and QuerySet filters

2007-07-10 Thread Malcolm Tredinnick
On Sun, 2007-07-08 at 20:16 +, Dan wrote: > This question may have been asked a thousand times, but I'm not sure > how to use the Parent/Child category database model given here: > http://code.djangoproject.com/wiki/CookBookCategoryDataModelPostMagic > > I have a model Item with category as a

Parent / Child Categories and QuerySet filters

2007-07-08 Thread Dan
This question may have been asked a thousand times, but I'm not sure how to use the Parent/Child category database model given here: http://code.djangoproject.com/wiki/CookBookCategoryDataModelPostMagic I have a model Item with category as a ForeignKey. I'd like to loop through all top level cate

QuerySet filters & AJAX

2006-09-25 Thread Robert
Hi, I've managed to implement the Changelist class from the Admin in my own view. I needed to get the list_filter in my own view. Changed filters display from lists to selects. Now I have my model listed in a table, and can sort/filter by some records. I also implemented a jumpTo() javascript, s