Re: [Django] #14658: DateField initial does not honor locale, against documentation

2013-10-15 Thread Django
#14658: DateField initial does not honor locale, against documentation
+--
 Reporter:  intgr   |Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Forms   |  Version:  1.5
 Severity:  Normal  |   Resolution:  needsinfo
 Keywords:  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--
Changes (by claudep):

 * status:  new => closed
 * resolution:   => needsinfo


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.3be1785473d8dcde9241997581bdc55a%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #14658: DateField initial does not honor locale, against documentation

2013-10-14 Thread Django
#14658: DateField initial does not honor locale, against documentation
+--
 Reporter:  intgr   |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  Forms   |  Version:  1.5
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--

Comment (by claudep):

 Could you please test with master? I just fixed a related bug in #21173.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.b03481c8cec4586a7fcc313e59227d17%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #14658: DateField initial does not honor locale, against documentation

2013-10-13 Thread Django
#14658: DateField initial does not honor locale, against documentation
+--
 Reporter:  intgr   |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  Forms   |  Version:  1.5
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--
Changes (by pylot):

 * stage:  Accepted => Unreviewed


Comment:

 I did some tests... it seems like it has to do something with file caching
 ... so testing with one file leads to a working solution, but this is not
 what is done in practice, especially with model forms


 first in file test_app.models define the model to be tested:

 {{{
 import datetime

 class Material(models.Model):
 date = models.DateTimeField(default=datetime.datetime.now,
 blank=True)
 }}}

 in test_app.forms define the form which is not working as suspected
 {{{
 from django import forms
 from test_app.models import Material

 class TestForm(forms.ModelForm):
 class Meta:
 model = Material
 }}}


 then i created a view to test it in a live environment to compare:
 - a ModelForm which is created (and working) in this file
 - a ModelForm which is imported

 both work with the imported Model, so there should be no difference

 {{{
 def test_date(request):
 from django import forms
 from django.shortcuts import render_to_response
 from test_app.models import Material
 from test_app.forms import TestForm

 class MaterialTestForm(forms.ModelForm):
 class Meta:
 model = Material

 import_form = TestForm()
 direct_form = MaterialTestForm()

 return render_to_response("test_date.html", locals(),
 RequestContext(request))
 }}}

 in the template compare the output of {{import_form}} and {{direct_form}},
 first no differnce, then switch languages, and you see the import_form is
 not updated and still displaying the refreshed date with the locale first
 initialized...

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.6df9adc1af106f88f2a9ed690ec49bd1%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #14658: DateField initial does not honor locale, against documentation

2013-10-13 Thread Django
#14658: DateField initial does not honor locale, against documentation
+
 Reporter:  intgr   |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  Forms   |  Version:  1.5
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by anonymous):

 * version:  1.2 => 1.5


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.a9ac0dc9ac50dc25b01245f84224e6b4%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #14658: DateField initial does not honor locale, against documentation

2013-10-13 Thread Django
#14658: DateField initial does not honor locale, against documentation
+
 Reporter:  intgr   |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  Forms   |  Version:  1.2
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by pylot):

 * status:  closed => new
 * resolution:  worksforme =>


Comment:

 line 5 should be 'en'

 anyway, output is 2x:

 {{{
 Date:
 }}}

 seems to be fetched only once the server starts... suspicous

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.3eaafbb246d941e747791e39a949bf32%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #14658: DateField initial does not honor locale, against documentation

2013-10-13 Thread Django
#14658: DateField initial does not honor locale, against documentation
+--
 Reporter:  intgr   |Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Forms   |  Version:  1.2
 Severity:  Normal  |   Resolution:  worksforme
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--

Comment (by pylot):

 {{{
 import datetime
 from django import forms
 from django.utils.translation import activate, deactivate

 activate('de')

 class deDateForm(forms.Form):
 date = forms.DateTimeField()
 def __init__(self, *args, **kwargs):
 super(self.__class__, self).__init__(*args, **kwargs)
 self.fields['date'].initial = datetime.datetime.now

 class enDateForm(forms.Form):
 date = forms.DateTimeField()
 def __init__(self, *args, **kwargs):
 super(self.__class__, self).__init__(*args, **kwargs)
 self.fields['date'].initial = datetime.datetime.now


 e = enDateForm()

 deactivate()
 activate('de')

 d = deDateForm()
 print e
 print '-'
 print d
 }}}

 Result:

 {{{
 Date:
 Date:
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.7f4fd9d96d1255b2d2a54bad14e641cb%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #14658: DateField initial does not honor locale, against documentation

2012-12-01 Thread Django
#14658: DateField initial does not honor locale, against documentation
+--
 Reporter:  intgr   |Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Forms   |  Version:  1.2
 Severity:  Normal  |   Resolution:  worksforme
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--
Changes (by claudep):

 * status:  new => closed
 * resolution:   => worksforme


Comment:

 Just ran this snippet with current 1.5 code:
 {{{
 import datetime
 from django import forms
 from django.utils.translation import activate

 activate('fr')

 class DateForm(forms.Form):
 day = forms.DateField(initial=datetime.date.today)

 print(DateForm())
 }}}

 Result:
 {{{
 Day:
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #14658: DateField initial does not honor locale, against documentation

2012-08-23 Thread Django
#14658: DateField initial does not honor locale, against documentation
+
 Reporter:  intgr   |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  Forms   |  Version:  1.2
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by nferrari):

 Hi,

 I didn't take time to patch Django yet but here's the trick to have a
 forms.DateField localized initial value:

 {{{
 #!div style="font-size: 80%"
 Code highlighting:
   {{{#!python
   date = forms.DateField(initial=lambda:
 django.utils.formats.localize_input(datetime.date.today()))
   }}}
 }}}

 Regards,

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #14658: DateField initial does not honor locale, against documentation

2011-06-21 Thread Django
#14658: DateField initial does not honor locale, against documentation
+
   Reporter:  intgr |  Owner:  nobody
   Type:  Bug   | Status:  new
  Milestone:|  Component:  Forms
Version:  1.2   |   Severity:  Normal
 Resolution:|   Keywords:
   Triage Stage:  Accepted  |  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
  UI/UX:  0 |
+
Changes (by jedie):

 * cc: django@… (added)
 * ui_ux:   => 0
 * easy:   => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14658: DateField initial does not honor locale, against documentation

2011-04-01 Thread Django
#14658: DateField initial does not honor locale, against documentation
+--
   Reporter:  intgr |Owner:  nobody
   Type:  Bug   |   Status:  new
  Milestone:|Component:  Forms
Version:  1.2   | Severity:  Normal
 Resolution:| Keywords:
   Triage Stage:  Accepted  |Has patch:  0
Needs documentation:  0 |  Needs tests:  0
Patch needs improvement:  0 |
+--
Changes (by jaddison):

 * type:   => Bug
 * severity:   => Normal


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14658: DateField initial does not honor locale, against documentation

2010-11-13 Thread Django
#14658: DateField initial does not honor locale, against documentation
---+
  Reporter:  intgr | Owner:  nobody
Status:  new   | Milestone:
 Component:  Forms |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by rasca):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 I can confirm this happens.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #14658: DateField initial does not honor locale, against documentation

2010-11-10 Thread Django
#14658: DateField initial does not honor locale, against documentation
---+
 Reporter:  intgr  |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Forms  | Version:  1.2   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 The documentation at
 
http://docs.djangoproject.com/en/dev/ref/forms/fields/#django.forms.Field.initial
 suggests that when passing the `intial=` argument to Date``Field, it's
 converted to the locale date format:
 {{{
 >>> import datetime
 >>> class DateForm(forms.Form):
 ... day = forms.DateField(initial=datetime.date.today)
 >>> print DateForm()
 Day:
 }}}

 Notice that `value="12/23/2008"` is localized.

 However, this does not seem to work in practice:
 {{{
 In [1]: from django import forms

 In [2]: import datetime

 In [3]: class DateForm(forms.Form):
...: day = forms.DateField(initial=datetime.date.today)

 In [4]: print DateForm()
 Day:
 }}}
 Notice above `value="2010-11-10"` -- it behaves this way in both Django
 1.2.3 and in trunk.

 Compare this to what the templater uses with its `|date` filter:

 {{{
 In [10]: from django.template import Template, Context

 In [11]: t=Template("{{ foo|date }}")

 In [12]: t.render(Context({'foo': datetime.date.today()}))
 Out[12]: u'10.11.2010'

 In [13]: from django.conf import settings

 In [14]: settings.DATE_FORMAT
 Out[14]: 'd.m.Y'

 In [15]: settings.DATETIME_FORMAT
 Out[15]: 'd.m.Y H:M:s'

 In [16]: settings.USE_L10N
 Out[16]: True
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.