Re: Django: Add SET DATESTYLE
class ModelForm(forms.Form): test_date = forms.DateField(required=False) ,,, INSERT INTO SQL: obj.test_date = test_date All OK for default format ( 2009-12-31 ). But for InputFormat "30.12.2009" - error. How to change InputFormat for all forms in application ? On 10 авг, 20:08, Karen Traceywrote: > On Mon, Aug 10, 2009 at 12:00 PM, Bdfy wrote: > > > How to add a phrase "SET DATESTYLE =" bla-bla-bla "" for everyone SQL > > query ? > > Why do you think you want to do that? The Django ORM takes the date(time) > values coming from the database and converts them do Python date(time) > objects. You can then control how they are formatted for output using > Python date formatting mechanisms. If you are using forms, the widgets for > date and time allow you to specify the format for output. Similarly for > input, you have control over what formats are accepted. The format that is > used for communication between the database and the Django ORM should not > matter to your code at all. > > Karen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django: Add SET DATESTYLE
On Mon, Aug 10, 2009 at 12:00 PM, Bdfywrote: > > How to add a phrase "SET DATESTYLE =" bla-bla-bla "" for everyone SQL > query ? > Why do you think you want to do that? The Django ORM takes the date(time) values coming from the database and converts them do Python date(time) objects. You can then control how they are formatted for output using Python date formatting mechanisms. If you are using forms, the widgets for date and time allow you to specify the format for output. Similarly for input, you have control over what formats are accepted. The format that is used for communication between the database and the Django ORM should not matter to your code at all. Karen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Django: Add SET DATESTYLE
How to add a phrase "SET DATESTYLE =" bla-bla-bla "" for everyone SQL query ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---