omniport-backend icon indicating copy to clipboard operation
omniport-backend copied to clipboard

Add a validator on PeriodMixin itself, raising validation error if the dates overlaps.

Open shreyansh23 opened this issue 6 years ago • 2 comments

shreyansh23 avatar Feb 10 '19 16:02 shreyansh23

Django does not support model validation on two fields. The most that can be done as of now is to create a function validate_dates() that you would have to call manually by overriding save() in your model class.

Would that solve or mitigate your issue?

dhruvkb avatar Feb 13 '19 06:02 dhruvkb

Yes, that will work fine!

shreyansh23 avatar Feb 13 '19 06:02 shreyansh23