Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

Commit

Permalink
[models] Improved Config.templates.through __str__ repr
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Feb 8, 2017
1 parent f16768d commit 96f4d09
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions django_netjsonconfig/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ class Meta(AbstractConfig.Meta):
abstract = False


def sortedm2m__str__(self):
"""
Improves string representation of m2m relationship objects
"""
return self.config.name


Config.templates.through.__str__ = sortedm2m__str__


class Template(AbstractTemplate):
"""
Concrete Template model
Expand Down

0 comments on commit 96f4d09

Please sign in to comment.