Re: Help with Manager.

2010-10-15 Thread Alec Shaner
Sorry, not sure about that warning because I'm using a postgresql database. On Fri, Oct 15, 2010 at 3:17 AM, Marc Aymerich wrote: > > > On Fri, Oct 15, 2010 at 3:39 AM, Alec Shaner wrote: >> >> You can't add a datetime to another datetime - you want to add a >> datetime.timedelta instance instea

Re: Help with Manager.

2010-10-15 Thread Marc Aymerich
On Fri, Oct 15, 2010 at 3:39 AM, Alec Shaner wrote: > You can't add a datetime to another datetime - you want to add a > datetime.timedelta instance instead. Out of curiosity I just tested it > on one of my models and it does work, e.g., > > MyModel.objects.filter(update_date__gt=F('entry_date')+

Re: Help with Manager.

2010-10-14 Thread Alec Shaner
You can't add a datetime to another datetime - you want to add a datetime.timedelta instance instead. Out of curiosity I just tested it on one of my models and it does work, e.g., MyModel.objects.filter(update_date__gt=F('entry_date')+timedelta(days=5)) On Thu, Oct 14, 2010 at 5:57 PM, Marc Aymer

Re: Help with Manager.

2010-10-14 Thread Marc Aymerich
On Thu, Oct 14, 2010 at 10:08 PM, Alec Shaner wrote: > See this: > > http://ifacethoughts.net/2009/07/14/calculated-fields-in-django/ > > So perhaps the 'extra' query filter is what you need. > > Yep, I got a success using extra filter :) Thanks Alec for sharing this! by the way, just right now

Re: Help with Manager.

2010-10-14 Thread Alec Shaner
See this: http://ifacethoughts.net/2009/07/14/calculated-fields-in-django/ So perhaps the 'extra' query filter is what you need. 2010/10/14 Marc Aymerich : > > > 2010/10/14 Marc Aymerich >> >> >> 2010/10/14 Jonathan Barratt >>> >>> On 14 ต.ค. 2010, at 22:27, Marc Aymerich wrote: >>> >>> Hi, >>

Re: Help with Manager.

2010-10-14 Thread Marc Aymerich
2010/10/14 Marc Aymerich > > > 2010/10/14 Jonathan Barratt > >> On 14 ?.?. 2010, at 22:27, Marc Aymerich wrote: >> >> Hi, >> I'm trying to make a Manager for my model "order". I want that it returns >> all orders that their 'active period'* is greater than a certain threshold. >> With "active pe

Re: Help with Manager.

2010-10-14 Thread Marc Aymerich
2010/10/14 Jonathan Barratt > On 14 ?.?. 2010, at 22:27, Marc Aymerich wrote: > > Hi, > I'm trying to make a Manager for my model "order". I want that it returns > all orders that their 'active period'* is greater than a certain threshold. > With "active period" I mean: (order.cancel_date - order

Re: Help with Manager.

2010-10-14 Thread Marc Aymerich
2010/10/14 Jonathan Barratt > On 14 ?.?. 2010, at 22:27, Marc Aymerich wrote: > > Hi, > I'm trying to make a Manager for my model "order". I want that it returns > all orders that their 'active period'* is greater than a certain threshold. > With "active period" I mean: (order.cancel_date - order

Re: Help with Manager.

2010-10-14 Thread Jonathan Barratt
On 14 ?.?. 2010, at 22:27, Marc Aymerich wrote: > Hi, > I'm trying to make a Manager for my model "order". I want that it returns all > orders that their 'active period'* is greater than a certain threshold. With > "active period" I mean: (order.cancel_date - order.register_date ) > > My Order

Help with Manager.

2010-10-14 Thread Marc Aymerich
Hi, I'm trying to make a Manager for my model "order". I want that it returns all orders that their 'active period'* is greater than a certain threshold. With "active period" I mean: (order.cancel_date - order.register_date ) My Order model looks like this: class order(models.Model): register