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

Fixed #25774 -- Refactor datetime expressions into public API

This commit is contained in:
Josh Smeaton
2016-03-05 23:05:47 +11:00
parent 77b73e79a4
commit 2a4af0ea43
15 changed files with 1429 additions and 225 deletions

View File

@@ -41,3 +41,18 @@ class Fan(models.Model):
def __str__(self):
return self.name
@python_2_unicode_compatible
class DTModel(models.Model):
name = models.CharField(max_length=32)
start_datetime = models.DateTimeField(null=True, blank=True)
end_datetime = models.DateTimeField(null=True, blank=True)
start_date = models.DateField(null=True, blank=True)
end_date = models.DateField(null=True, blank=True)
start_time = models.TimeField(null=True, blank=True)
end_time = models.TimeField(null=True, blank=True)
duration = models.DurationField(null=True, blank=True)
def __str__(self):
return 'DTModel({0})'.format(self.name)