Skip to content

Commit

Permalink
[models] Updated sortedm2m __str__ definition
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Aug 29, 2017
1 parent c4c9ba2 commit 934be13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions openwisp_controller/config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from django_netjsonconfig.base.config import TemplatesVpnMixin as BaseMixin
from django_netjsonconfig.base.config import AbstractConfig, sortedm2m__str__
from django_netjsonconfig.base.config import AbstractConfig, TemplatesThrough
from django_netjsonconfig.base.device import AbstractDevice
from django_netjsonconfig.base.tag import AbstractTaggedTemplate, AbstractTemplateTag
from django_netjsonconfig.base.template import AbstractTemplate
Expand Down Expand Up @@ -83,6 +83,7 @@ class Config(OrgMixin, TemplatesVpnMixin, AbstractConfig):
templates = SortedManyToManyField('config.Template',
related_name='config_relations',
verbose_name=_('templates'),
base_class=TemplatesThrough,
blank=True,
help_text=_('configuration templates, applied from '
'first to last'))
Expand All @@ -100,9 +101,6 @@ def clean(self):
super(Config, self).clean()


Config.templates.through.__str__ = sortedm2m__str__


class TemplateTag(AbstractTemplateTag):
"""
openwisp-controller TemplateTag model
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
django-netjsonconfig>=0.6.3,<0.7.0
django-netjsonconfig>=0.6.4,<0.7.0
openwisp-utils[users]<0.2

0 comments on commit 934be13

Please sign in to comment.