add default ordering to schedule models
This commit is contained in:
parent
8cc9603814
commit
d98f9b82a8
2 changed files with 8 additions and 1 deletions
|
@ -93,6 +93,9 @@ class Slot(models.Model):
|
|||
|
||||
def __unicode__(self):
|
||||
return "%s %s (%s - %s)" % (self.day, self.kind, self.start, self.end)
|
||||
|
||||
class Meta:
|
||||
ordering = ["day", "start", "end"]
|
||||
|
||||
|
||||
class SlotRoom(models.Model):
|
||||
|
@ -108,6 +111,7 @@ class SlotRoom(models.Model):
|
|||
|
||||
class Meta:
|
||||
unique_together = [("slot", "room")]
|
||||
ordering = ["slot", "room__order"]
|
||||
|
||||
|
||||
class Presentation(models.Model):
|
||||
|
@ -139,3 +143,6 @@ class Presentation(models.Model):
|
|||
|
||||
def __unicode__(self):
|
||||
return "#%s %s (%s)" % (self.number, self.title, self.speaker)
|
||||
|
||||
class Meta:
|
||||
ordering = ["slot"]
|
||||
|
|
|
@ -61,7 +61,7 @@ def schedule_list(request, slug=None):
|
|||
schedule = fetch_schedule(slug)
|
||||
|
||||
presentations = Presentation.objects.filter(section=schedule.section)
|
||||
presentations = presentations.exclude(cancelled=True).order_by("id")
|
||||
presentations = presentations.exclude(cancelled=True)
|
||||
|
||||
ctx = {
|
||||
"schedule": schedule,
|
||||
|
|
Loading…
Reference in a new issue