Re: format date output in mail form

2009-12-21 Thread rvandam
@Guilherme Cavalcanti I haven't thought of using a template for the mail. That will be my next approach for this problem. Thank you for this. For now I have this in my model: Aankomst = form.cleaned_data['Aankomst'] aankomst = str(Aankomst)

Re: format date output in mail form

2009-12-21 Thread Guilherme Cavalcanti
Take a look: template = get_template("email/notification.html") ctx = Context({'title': self.title, 'update_account_link': "#", 'update_km_link': "#", 'date': datetime.now(), 'user': self.user_profile.user.username, 'text': self.text, 'aviseme_link': "#",

Re: format date output in mail form

2009-12-21 Thread Guilherme Cavalcanti
Hello, can you show how date is being printed? Maybe if you try to create an "template" using {{ date|date:"j N \d\e Y" }} (or what else format you want) and just call render passing an context with the datetime object. On Dec 21, 9:26 am, rvandam wrote: > I found some

Re: format date output in mail form

2009-12-21 Thread rvandam
I found some date formatting in forms/fields.py, forms/widgets.py and in contrib/localflavor/generic/forms.py. I tried if small modifications resulted in a different output, but nothing worked. I also tried to change the local setting in settings.py. Is there a way to modify the date ouptut

format date output in mail form

2009-12-18 Thread rvandam
I saw a solution on the list to format a datefield in a template. Unfortunately i didnt find any solution for formatting a datefield in a mailform. I have this in my model: Aankomst = forms.DateField(('%d/%m/%Y',), widget=forms.DateTimeInput (format='%d/%m/%Y', attrs={