diff options
Diffstat (limited to 'tests/modeltests/custom_methods/models.py')
| -rw-r--r-- | tests/modeltests/custom_methods/models.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/modeltests/custom_methods/models.py b/tests/modeltests/custom_methods/models.py index 4e3da58851..cef3fd722b 100644 --- a/tests/modeltests/custom_methods/models.py +++ b/tests/modeltests/custom_methods/models.py @@ -7,13 +7,15 @@ Any method you add to a model will be available to instances. import datetime from django.db import models +from django.utils.encoding import python_2_unicode_compatible +@python_2_unicode_compatible class Article(models.Model): headline = models.CharField(max_length=100) pub_date = models.DateField() - def __unicode__(self): + def __str__(self): return self.headline def was_published_today(self): |
