Hi,
I’ve been developing an application that makes use of the DRF. I have lots of conditions regarding data, for example a model called ‘Instrument’ with a status field (active, inactive) which has a foreign key to a ‘Tag’. Many instruments may reference one tag, but only one of those instruments per tag may have a status of ‘Active’ at any given time.
Currently any sort of conditions like this I handle in my ModelViewSets in the create/update functions etc, but this obviously does not apply the logic to any modifications performed outside of the DRF (i.e. django admin panel).
What is the accepted practice for enforcing these types of constraints on data?
Thanks!