Re: Iteration over queryset in a model

2011-10-27 Thread eyscooby
I kinda came across an article about creating Proxy Models, that is what I tried and it really seemed to do what I needed, pretty cool. Here is what I coded ...(sorry for the formatting, if it looks goofy) Edit “models.py” file: (create the new Proxy Model) class RequestTicketCompleted(RequestT

Re: Iteration over queryset in a model

2011-10-24 Thread eyscooby
So with the items that are still waiting to be complete i wanted to show how many days the ticket has been open by doing something like ... return date.today() - self.issued_date and then those that are complete ... return self.competion_date - self.issued_date Can i create 2 managers f

Re: Iteration over queryset in a model

2011-10-18 Thread eyscooby
Ok, this is helping, believe it or not your are helping, I'm probably confusing myself mostly. So the model method explanation was very helpful and you are correct that works great, as long as all dates have a completion_date. If a new ticket is entered it will fail due to a "NoneType field with

Re: Iteration over queryset in a model

2011-10-18 Thread Daniel Roseman
On Monday, 17 October 2011 20:28:47 UTC+1, eyscooby wrote: > > Ok, sorry I thought I was starting to understand it a little better, > but now I think I took a step backwards, so if it is ok with you let's > step back and take it a step at a time. > > So, my first step is wondering if I really ne

Re: Iteration over queryset in a model

2011-10-17 Thread eyscooby
Ok, sorry I thought I was starting to understand it a little better, but now I think I took a step backwards, so if it is ok with you let's step back and take it a step at a time. So, my first step is wondering if I really need a manager or not?? I was thinking from your first response to me that

Re: Iteration over queryset in a model

2011-10-12 Thread Daniel Roseman
On Tuesday, 11 October 2011 15:17:18 UTC+1, eyscooby wrote: > > slowly getting there thanks to your help. > I am actually trying to accomplish this in the Admin interface, so I > am not sure how to use the template tag {{ ticket.days_old }} in that > situation. > > the other part I left off yes

Re: Iteration over queryset in a model

2011-10-11 Thread eyscooby
slowly getting there thanks to your help. I am actually trying to accomplish this in the Admin interface, so I am not sure how to use the template tag {{ ticket.days_old }} in that situation. the other part I left off yesterday under my model I then had.. (trying to get code formatting correct but

Re: Iteration over queryset in a model

2011-10-10 Thread Daniel Roseman
On Monday, 10 October 2011 19:14:51 UTC+1, eyscooby wrote: > > > > On Oct 5, 3:11 am, Daniel Roseman wrote: > > On Wednesday, 5 October 2011 01:27:54 UTC+1, eyscooby wrote: > > > > > new to django/python developement, can't get this one figured out. > > > > > I have a model that has a couple

Re: Iteration over queryset in a model

2011-10-10 Thread eyscooby
On Oct 5, 3:11 am, Daniel Roseman wrote: > On Wednesday, 5 October 2011 01:27:54 UTC+1, eyscooby wrote: > > > new to django/python developement, can't get this one figured out. > > > I have a model that has a couple DateFields (issued_date & > > completion_date), and I'm trying to return a value

Re: Iteration over queryset in a model

2011-10-05 Thread Daniel Roseman
On Wednesday, 5 October 2011 01:27:54 UTC+1, eyscooby wrote: > > new to django/python developement, can't get this one figured out. > > I have a model that has a couple DateFields (issued_date & > completion_date), and I'm trying to return a value with the difference > of the two on each entry

Iteration over queryset in a model

2011-10-04 Thread eyscooby
new to django/python developement, can't get this one figured out. I have a model that has a couple DateFields (issued_date & completion_date), and I'm trying to return a value with the difference of the two on each entry that is complete, and then if it isn't completed yet, show the amount of day