mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
filter out base by default
This commit is contained in:
parent
6f8909c710
commit
7130bacf95
@ -34,9 +34,13 @@ class MixinBase:
|
|||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def registered_mixins(self):
|
def registered_mixins(self, with_base: bool=False):
|
||||||
mxins = getattr(self, '_mixinreg', None)
|
mxins = getattr(self, '_mixinreg', None)
|
||||||
if mxins:
|
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()]
|
mxins = [a for a in mxins.values()]
|
||||||
return mxins
|
return mxins
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user