Changeset - d98f9b82a85b
[Not reviewed]
0 2 0
Luke Hatcher - 12 years ago 2012-12-20 06:53:22
lukeman@gmail.com
add default ordering to schedule models
2 files changed with 8 insertions and 1 deletions:
0 comments (0 inline, 0 general)
symposion/schedule/models.py
Show inline comments
...
 
@@ -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"]
symposion/schedule/views.py
Show inline comments
...
 
@@ -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 (0 inline, 0 general)