1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #24485 -- Allowed combined expressions to set output_field

This commit is contained in:
Josh Smeaton
2015-03-19 14:07:53 +11:00
parent 127b3873d0
commit 02a2943e4c
6 changed files with 99 additions and 19 deletions

View File

@@ -84,3 +84,12 @@ class Company(models.Model):
return ('Company(name=%s, motto=%s, ticker_name=%s, description=%s)'
% (self.name, self.motto, self.ticker_name, self.description)
)
@python_2_unicode_compatible
class Ticket(models.Model):
active_at = models.DateTimeField()
duration = models.DurationField()
def __str__(self):
return '{} - {}'.format(self.active_at, self.duration)