Changes between Initial Version and Version 1 of Ticket #29852, comment 8


Ignore:
Timestamp:
Oct 16, 2018, 5:52:57 PM (6 years ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29852, comment 8

    initial v1  
    11Well I think the current behaviour of the serializer regarding `SimpleLazyObject` is correct but `Promise` objects handling would need to be adjusted.
    22
    3 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()`.
     3In 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 at validator initialization time but `lazy(datetime.datetime.now, datetime.datetime)() != lazy(datetime.datetime.now, datetime.datetime)()` because `datetime.datetime.now() != datetime.datetime.now()`.
    44
    55I 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?
Back to Top