2π
β
I started doing Django before the Great ORM Rewrite, so I got in the habit of creating a MixIn class that gave a lot of common functionality across all of our content classes. Stuff like common URL creation schemes, membership-level checking functions, etc. etc.
Since we used a very consistent naming scheme across all of our models, this approximates an ABC, but itβs just Good Old Python. A model declaration would look like:
class SomeModel(models.Model, MixInClass):
pass
π€Peter Rowell
Source:stackexchange.com