2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-30 12:36:45 +00:00

added version identifier

This commit is contained in:
Matthias 2021-10-04 22:10:31 +02:00
parent ef858f7701
commit e7237d13ae
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 9 additions and 0 deletions

View File

@ -258,6 +258,7 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
AUTHOR = None
PUBLISH_DATE = None
VERSION = None
def __init__(self):
super().__init__()
@ -304,6 +305,12 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
name = _('No date found')
return name
@property
def version(self):
"""returns version of plugin"""
name = getattr(self, 'VERSION', None)
return name
# mixins
def mixin(self, key):
"""check if mixin is registered"""

View File

@ -20,6 +20,7 @@
<th>{% trans "Name" %}</th>
<th>{% trans "Author" %}</th>
<th>{% trans "Date" %}</th>
<th>{% trans "Version" %}</th>
</tr>
</thead>
@ -48,6 +49,7 @@
</td>
<td>{{ plugin.author }}</td>
<td>{{ plugin.pub_date }}</td>
<td>{{ plugin.version }}</td>
</tr>
{% endfor %}
</tbody>