Re: [Django] #18607: ModelForms do not recognize DateTimeFields with auto_now=True

2016-03-23 Thread Django
#18607: ModelForms do not recognize DateTimeFields with auto_now=True
+--
 Reporter:  Adys|Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Forms   |  Version:  1.4
 Severity:  Normal  |   Resolution:  invalid
 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 rschwiebert):

 The datetime field I'm using has `editable=True` and the ModelForm fails
 for the same reason. For insurance I also put auto_add=False and
 auto_now_add =False. Same problem.

 Maybe the above comments explain the problem, but it doesn't explain how
 to overcome it.

--
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/062.391ca357da491acaced0151e7e45f978%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #18607: ModelForms do not recognize DateTimeFields with auto_now=True

2012-07-10 Thread Django
#18607: ModelForms do not recognize DateTimeFields with auto_now=True
+--
 Reporter:  Adys|Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Forms   |  Version:  1.4
 Severity:  Normal  |   Resolution:  invalid
 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 akaariai):

 It kind of is: the auto_now documentation says that setting it to true
 implies editable=False, and editable is documented as:

 > If False, the field will not be editable in the admin or via forms
 automatically generated from the model class. Default is True.

 Now, the editable documentation could perhaps be a little cleaner - it
 doesn't explicitly state the field is totally removed from the form, just
 that it is not editable.

 As for regressions, I don't think there are any guarantees for pre 1.0
 versions.

-- 
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] #18607: ModelForms do not recognize DateTimeFields with auto_now=True

2012-07-10 Thread Django
#18607: ModelForms do not recognize DateTimeFields with auto_now=True
+--
 Reporter:  Adys|Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Forms   |  Version:  1.4
 Severity:  Normal  |   Resolution:  invalid
 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 Adys):

 In that case, it's something worth mentioning in the docs (either in the
 ModelForm or the DateTimeField or both), it was the source of a lot of
 pain and work trying to figure out what was going on, especially as it's a
 regression.

-- 
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] #18607: ModelForms do not recognize DateTimeFields with auto_now=True

2012-07-10 Thread Django
#18607: ModelForms do not recognize DateTimeFields with auto_now=True
+--
 Reporter:  Adys|Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Forms   |  Version:  1.4
 Severity:  Normal  |   Resolution:  invalid
 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 akaariai):

 * status:  new => closed
 * needs_docs:   => 0
 * resolution:   => invalid
 * needs_tests:   => 0
 * needs_better_patch:   => 0


Comment:

 It seems this is intentional. The user is not supposed to edit the field,
 and thus it is not present in the form. It seems you can display the field
 with using readonly_fields. [http://stackoverflow.com/questions/10033422
 /cant-display-datefield-on-form-with-auto-now-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-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.



[Django] #18607: ModelForms do not recognize DateTimeFields with auto_now=True

2012-07-10 Thread Django
#18607: ModelForms do not recognize DateTimeFields with auto_now=True
+
 Reporter:  Adys|  Owner:  nobody
 Type:  Bug | Status:  new
Component:  Forms   |Version:  1.4
 Severity:  Normal  |   Keywords:
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0   |  UI/UX:  0
+
 When creating a model with a DateTimeField(auto_now=True), the field is
 not present in a ModelForm (affects the django admin).

 {{{
 >>> from django.db.models import *
 >>> from django.forms import ModelForm
 >>> class Test(Model):
 ...  pub_date = DateTimeField(auto_now=True)
 ...  class Meta:
 ...   app_label = "editor"
 ...
 >>> class TestForm(ModelForm):
 ...  class Meta:
 ...   model = Test
 ...
 >>> TestForm()
 
 >>> TestForm().fields
 {}
 }}}

 Removing auto_now lets the field be recognized. This is a regression since
 django 0.9 if that's worth anything.

-- 
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.