mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
some docs for future users :-)
This commit is contained in:
parent
205916e0b2
commit
23f57bec19
@ -108,6 +108,15 @@ class GenericSettingClassMixin:
|
|||||||
REFERENCE_NAME = None
|
REFERENCE_NAME = None
|
||||||
|
|
||||||
def _get_reference(self):
|
def _get_reference(self):
|
||||||
|
"""
|
||||||
|
Returns dict that can be used as an argument for kwargs calls.
|
||||||
|
Helps to make overriden calls generic for simple reuse.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```python
|
||||||
|
some_random_function(argument0, kwarg1=value1, **self._get_reference())
|
||||||
|
```
|
||||||
|
"""
|
||||||
return {
|
return {
|
||||||
self.REFERENCE_NAME: getattr(self, self.REFERENCE_NAME)
|
self.REFERENCE_NAME: getattr(self, self.REFERENCE_NAME)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user