django-model-utils
django-model-utils copied to clipboard
Allows nullable MonitorField to be populated on creation
Problem
Monitor field does not gets populated on creation since the previous != current evaluates to False. The problem is when when is setted and not respected on creation.
Related issues:
- https://github.com/jazzband/django-model-utils/issues/401
- https://github.com/jazzband/django-model-utils/issues/352
Solution
Now 2 checks are done:
-
when is Nonewe useprevious != current -
when is not None: - we use previous != current and check if
current in when - (change here) check if is
add and current in when
Commandments
- [x] Write PEP8 compliant code.
- [x] Cover it with tests.
- [x] Update
CHANGES.rstfile to describe the changes, and quote according issue withGH-<issue_number>. - [x] Pay attention to backward compatibility, or if it breaks it, explain why.
- [x] Update documentation (if relevant).