Browse files

add default ordering to schedule models

  • Loading branch information...
1 parent 8cc9603 commit d98f9b82a85b2d9d7a8ebc36beca1f0cd9342894 @lukeman lukeman committed Dec 20, 2012
Showing with 8 additions and 1 deletion.
  1. +7 −0 symposion/schedule/models.py
  2. +1 −1 symposion/schedule/views.py
View
7 symposion/schedule/models.py
@@ -93,6 +93,9 @@ def rooms(self):
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 @@ def __unicode__(self):
class Meta:
unique_together = [("slot", "room")]
+ ordering = ["slot", "room__order"]
class Presentation(models.Model):
@@ -139,3 +143,6 @@ def speakers(self):
def __unicode__(self):
return "#%s %s (%s)" % (self.number, self.title, self.speaker)
+
+ class Meta:
+ ordering = ["slot"]
View
2 symposion/schedule/views.py
@@ -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,

0 comments on commit d98f9b8

Please sign in to comment.