#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 object at 0x2603890> >>> 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: <https://code.djangoproject.com/ticket/18607> Django <https://code.djangoproject.com/> 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.