Re: Update: Date formatting between model and form output

2008-09-26 Thread Gerard Petersen
Found an error in the model code. It should be this: if isinstance(self.period_start_date, datetime): Regards, Gerard, koenb wrote: > On 26 sep, 16:00, Gerard Petersen <[EMAIL PROTECTED]> wrote: >> Getting closer. This works: product.period_start_date.strftime('%d-%m-%Y') >> >> But I definite

Re: Update: Date formatting between model and form output

2008-09-26 Thread Gerard Petersen
Hi Koen, I'm using modelform, having tried the 'output_format' there does not seems to work. In the mean time I figured out a solution within the model like this: def __init__(self, *args, **kwargs): super(Product, self).__init__(*args, **kwargs) if not isinstance(self.peri

Re: Update: Date formatting between model and form output

2008-09-26 Thread koenb
On 26 sep, 16:00, Gerard Petersen <[EMAIL PROTECTED]> wrote: > Getting closer. This works: product.period_start_date.strftime('%d-%m-%Y') > > But I definitely do not want this in all view handlers. It should go in the > model .. or the modelform. > > Thanx again! > > Gerard. > > Gerard Petersen w

Update: Date formatting between model and form output

2008-09-26 Thread Gerard Petersen
Getting closer. This works: product.period_start_date.strftime('%d-%m-%Y') But I definitely do not want this in all view handlers. It should go in the model .. or the modelform. Thanx again! Gerard. Gerard Petersen wrote: > Hi all, > > I'm trying to have a formfield filled with a correlctly