Commit 6c2269a3 authored by Renfred Harper's avatar Renfred Harper
Browse files

Sort models alphabetically in admin

parent 9ef15a44
......@@ -14,6 +14,10 @@ class Restaurant(BaseModel):
special_schedules = models.ManyToManyField('Schedule',
related_name='restaurant_special', null=True, blank=True)
class Meta:
# Sort by name in admin view
ordering = ['name']
def isOpen(self):
......@@ -55,7 +59,10 @@ class Schedule(BaseModel):
help_text='Date that this schedule goes into effect')
valid_end = models.DateField('End Date', null=True, blank=True,
help_text='Last day that this schedule is in effect')
class Meta:
ordering = ['name']
def isOpenNow(self):
"""Return true if this schedule is open right now."""
for time in OpenTime.objects.filter(schedule=self):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment