#24391: UUIDField with default=uuid4 triggers validation on otherwise empty 
inline
formsets
-------------------------------+--------------------
     Reporter:  yoyoma         |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Forms          |    Version:  master
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 When using {{{DateTimeField(default=timezone.now)}}}, inline model
 formsets know to avoid validation when no fields are changed, even though
 there is a value in that given {{{DateTimeField}}}. However, when using
 another field ({{{UUIDField}}} in my case) I'm getting inline form
 validation on otherwise empty forms, presumably due to the default UUID
 being different than the one generated during POST.

 This is at least related to #24377, but since this isn't constrained to
 {{{primary_key=True}}} cases, it needs its own ticket. Could a general
 solution to this render a specific solution to #24377 moot, or are they
 two separate issues?

 == Digression ==

 How does this {{{if user changed the default datetime value: count the
 form as having been changed}}} functionality work, btw? My understanding
 of dynamic default values like this is that there would be no way for
 Django to know whether the value has changed, unless the default value was
 included in a hidden field, or set in cache or cookies on page load... I'd
 love to document this, because if a user creates their own form field they
 might want to build in this sort of functionality.

--
Ticket URL: <https://code.djangoproject.com/ticket/24391>
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.a0edd3856d44927dc8dff5d854e5d99d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to