#24302: DurationField form field value populated with instance.__repr__()
----------------------------------------------+-----------------------
     Reporter:  yoyoma                        |      Owner:  nobody
         Type:  Uncategorized                 |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  1.8alpha1
     Severity:  Normal                        |   Keywords:
 Triage Stage:  Unreviewed                    |  Has patch:  0
Easy pickings:  0                             |      UI/UX:  0
----------------------------------------------+-----------------------
 Or,


 == DurationField doesn't accept input in the format of its own output ==

 In the admin's add view for a model of mine I entered a 1 day duration in
 {{{1 0:00}}} format into the input for a {{{DurationField}}} on the model,
 I saved my model instance. This worked fine, and redirected me back to the
 admin list view, where that instance's {{{DurationField}}}'s value was
 displayed as {{{1 day, 0:00:00}}} (default {{{timedelta.__repr__}}}). I
 visited the instance's change view, where the same input now also
 contained {{{1 day, 0:00:00}}} (default {{{timedelta.__repr__}}} again). I
 tried saving the instance again, and received a validation error of {{{'1
 day, 0:00:00' value has an invalid format. It must be in [DD]
 [HH:[MM:]]ss[.uuuuuu] format.}}} (raised in
 {{{django.db.models.fields.DurationField.to_python}}}).

--
Ticket URL: <https://code.djangoproject.com/ticket/24302>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.a44110fb6b0b6c5dce88fa907ba1e09c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to