Videos that have been properly transcoded are marked active, whereas videos that have been deactivated or are being processed are marked inactive. I have two questions stemming from this:
1) What would be the best way to show this in the database. Would it be a Boolean field active, or something else that I am missing?
2) What would be the best way to handle searches, etc. for videos, as inactive videos should never, ever appear? Is there an easy way to set a query in the model definition such that only active videos will show?
Any explanation of the best way to handle this active vs. inactive case would be extremely helpful. Thank you.
The typical way to handle this is a boolean field on the Video model, and then a new manager to return only active videos. You can even make this manager the default, so that it’s used unless you explicitly ask for inactive videos.
Here’s a sketch: