Commit 042278ca authored by Nicholas Anderson's avatar Nicholas Anderson

Convert to Python3

parent b6b0ebf6
......@@ -14,7 +14,7 @@ class Category(BaseModel):
# Sort by name in admin view
ordering = ['name']
def __unicode__(self):
def __str__(self):
return self.name
class Facility(BaseModel):
......@@ -25,7 +25,7 @@ class Facility(BaseModel):
main_schedule = models.ForeignKey('Schedule',
related_name='facility_main')
special_schedules = models.ManyToManyField('Schedule',
related_name='facility_special', null=True, blank=True)
related_name='facility_special', blank=True)
class Meta:
verbose_name = "facility"
......@@ -55,10 +55,11 @@ class Facility(BaseModel):
return True
return False
def __unicode__(self):
def __str__(self):
return self.name
class Schedule(BaseModel):
"""
Contains opening and closing times for each day in a week.
......@@ -84,7 +85,7 @@ class Schedule(BaseModel):
return True
return False
def __unicode__(self):
def __str__(self):
return self.name
......@@ -121,9 +122,10 @@ class OpenTime(BaseModel):
return False
return True
def __unicode__(self):
def __str__(self):
weekdays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday',
'Saturday', 'Sunday']
return '%s %s to %s %s' % (weekdays[self.start_day],
self.start_time.strftime("%H:%M:%S"), weekdays[self.end_day],
self.end_time.strftime("%H:%M:%S"))
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