Skip to content

Commit 934be13

Browse files
committed
[models] Updated sortedm2m __str__ definition
1 parent c4c9ba2 commit 934be13

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

openwisp_controller/config/models.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from django.utils.encoding import python_2_unicode_compatible
66
from django.utils.translation import ugettext_lazy as _
77
from django_netjsonconfig.base.config import TemplatesVpnMixin as BaseMixin
8-
from django_netjsonconfig.base.config import AbstractConfig, sortedm2m__str__
8+
from django_netjsonconfig.base.config import AbstractConfig, TemplatesThrough
99
from django_netjsonconfig.base.device import AbstractDevice
1010
from django_netjsonconfig.base.tag import AbstractTaggedTemplate, AbstractTemplateTag
1111
from django_netjsonconfig.base.template import AbstractTemplate
@@ -83,6 +83,7 @@ class Config(OrgMixin, TemplatesVpnMixin, AbstractConfig):
8383
templates = SortedManyToManyField('config.Template',
8484
related_name='config_relations',
8585
verbose_name=_('templates'),
86+
base_class=TemplatesThrough,
8687
blank=True,
8788
help_text=_('configuration templates, applied from '
8889
'first to last'))
@@ -100,9 +101,6 @@ def clean(self):
100101
super(Config, self).clean()
101102

102103

103-
Config.templates.through.__str__ = sortedm2m__str__
104-
105-
106104
class TemplateTag(AbstractTemplateTag):
107105
"""
108106
openwisp-controller TemplateTag model

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
django-netjsonconfig>=0.6.3,<0.7.0
1+
django-netjsonconfig>=0.6.4,<0.7.0
22
openwisp-utils[users]<0.2

0 commit comments

Comments
 (0)