Changes between Initial Version and Version 1 of Ticket #29852, comment 8
- Timestamp:
- Oct 16, 2018, 5:52:57 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29852, comment 8
initial v1 1 1 Well I think the current behaviour of the serializer regarding `SimpleLazyObject` is correct but `Promise` objects handling would need to be adjusted. 2 2 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 validbut `lazy(datetime.datetime.now, datetime.datetime)() != lazy(datetime.datetime.now, datetime.datetime)()` because `datetime.datetime.now() != datetime.datetime.now()`.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 at validator initialization time but `lazy(datetime.datetime.now, datetime.datetime)() != lazy(datetime.datetime.now, datetime.datetime)()` because `datetime.datetime.now() != datetime.datetime.now()`. 4 4 5 5 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?