2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Simplify the various settings objects, to improve retrieval of 'parameters' from the base class

- Remove the GenericReferencedSettingsClass mixin
- Each subclass defines a very simple get_kwargs() method
- Now, at object level *and* class level we can perform lookup of settings and actually get proper data back
- Adds "model" option to setting (precursor of things to come)
This commit is contained in:
Oliver
2022-05-12 16:45:27 +10:00
parent 56f36d4b4b
commit e112d555d4
5 changed files with 105 additions and 114 deletions

View File

@ -22,6 +22,9 @@
{{ setting.description }}
</td>
<td>
{% if setting.model_name %}
<b>Model name: {{ setting.model_name }}</b>
{% endif %}
{% if setting.is_bool %}
<div class='form-check form-switch'>
<input class='form-check-input boolean-setting' fieldname='{{ setting.key.upper }}' pk='{{ setting.pk }}' setting='{{ setting.key.upper }}' id='setting-value-{{ setting.key.upper }}' type='checkbox' {% if setting.as_bool %}checked=''{% endif %} {% if plugin %}plugin='{{ plugin.slug }}'{% endif %}{% if user_setting %}user='{{request.user.id}}'{% endif %}{% if notification_setting %}notification='{{request.user.id}}'{% endif %}>