filter out base by default

This commit is contained in:
Matthias 2021-09-19 17:34:06 +02:00
parent 6f8909c710
commit 7130bacf95
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -34,9 +34,13 @@ class MixinBase:
}
@property
def registered_mixins(self):
def registered_mixins(self, with_base: bool=False):
mxins = getattr(self, '_mixinreg', None)
if mxins:
# filter out base
if not with_base and 'base' in mxins:
del mxins['base']
# only return dict
mxins = [a for a in mxins.values()]
return mxins