2👍
Apart from creating a new metaclass that inherits from both ABCMeta
and ModelBase
, or making there isn’t much you can do.ABCMeta
inherit from ModelBase
,
However, possibly a different registration pattern might be appropriate? Maybe something like Or a class decorator? Or a loop at the bottom of the contrib.admin.autodiscover
?.py
file which calls register
on the appropriate classes (ex, for var in globals().values(): if isinstance(var, type) and issubclass(var, AbastractBase): register(var)
)?
Edit: D’oh. I’d assumed that ABCMeta
was an example, not ABCMeta
. That’s what I get for browsing StackOverflow on too little sleep.
Source:stackexchange.com