Closed Jaymon closed 4 years ago
Another way to implement it:
def is_readonly(self):
if self.readonly:
raise NotImplementedError("This Orm is in readonly mode")
return False
def insert(self):
if not self.is_readonly():
return super(MyOrm, self).insert()
The base
prom.model.Orm
should be set up with readonly functionality, something like this:This would allow you to do something like:
To make sure you don't mess with the info in the db.