mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #22288 -- Fixed F() expressions with the __range lookup.
This commit is contained in:
parent
f6cd669ff2
commit
4f138fe5a4
11 changed files with 292 additions and 21 deletions
|
@ -61,6 +61,15 @@ class Experiment(models.Model):
|
|||
return self.end - self.start
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Result(models.Model):
|
||||
experiment = models.ForeignKey(Experiment, models.CASCADE)
|
||||
result_time = models.DateTimeField()
|
||||
|
||||
def __str__(self):
|
||||
return "Result at %s" % self.result_time
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Time(models.Model):
|
||||
time = models.TimeField(null=True)
|
||||
|
@ -69,6 +78,16 @@ class Time(models.Model):
|
|||
return "%s" % self.time
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class SimulationRun(models.Model):
|
||||
start = models.ForeignKey(Time, models.CASCADE, null=True)
|
||||
end = models.ForeignKey(Time, models.CASCADE, null=True)
|
||||
midpoint = models.TimeField()
|
||||
|
||||
def __str__(self):
|
||||
return "%s (%s to %s)" % (self.midpoint, self.start, self.end)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class UUID(models.Model):
|
||||
uuid = models.UUIDField(null=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue