Merge pull request #89 from m-vdb/mvdb/fix-str-representation

Fix Template string representation for python3
This commit is contained in:
Jannis Leidel 2019-01-27 21:58:28 +01:00 committed by GitHub
commit f5b9e36fc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,10 +8,12 @@ from django.contrib.sites.models import Site
from django.db import models
from django.db.models import signals
from django.template import TemplateDoesNotExist
from django.utils.six import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from django.utils.timezone import now
@python_2_unicode_compatible
class Template(models.Model):
"""
Defines a template model for use with the database template loader.
@ -36,7 +38,7 @@ class Template(models.Model):
verbose_name_plural = _('templates')
ordering = ('name',)
def __unicode__(self):
def __str__(self):
return self.name
def populate(self, name=None):