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

Sort models alphabetically in admin

parent 9ef15a44
......@@ -15,6 +15,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):
Return true if this restaurant is currently open.
......@@ -56,6 +60,9 @@ class Schedule(BaseModel):
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