#29852: Infinite migrations when using SimpleLazyObject in field arguments
------------------------------+------------------------------------
     Reporter:  Javier Buzzi  |                    Owner:  nobody
         Type:  Bug           |                   Status:  new
    Component:  Migrations    |                  Version:  master
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Accepted
    Has patch:  1             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  1
Easy pickings:  0             |                    UI/UX:  0
------------------------------+------------------------------------

Comment (by Simon Charette):

 Well I think the current behaviour of the serializer regarding
 `SimpleLazyObject` is correct but `Promise` objects handling would need to
 be adjusted.

 In the end we're facing the same `__eq__` proxy issue I mentioned in
 previous comments; `lazy(datetime.datetime.now, datetime.datetime)()`
 needs to be passed for the validation to be valid but
 `lazy(datetime.datetime.now, datetime.datetime)() !=
 lazy(datetime.datetime.now, datetime.datetime)()` because
 `datetime.datetime.now() != datetime.datetime.now()`.

 I beginning to think that the only way is to resolve this is allow
 callables to be passed as `BaseValidator(limit_value)`. That would allow
 you to specify `MinValueValidator(datetime.now)` which is easily
 deconstructible and doesn't involve promise wrapping. Thoughts?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29852#comment:8>
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/069.246cf08297a3af34cae1930e6fc6094c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to