opening_at for establishment

This commit is contained in:
Kuroshini 2019-12-04 13:52:39 +03:00
parent c5992afec0
commit 552e08e242
2 changed files with 5 additions and 0 deletions

View File

@ -116,6 +116,7 @@ class EstablishmentDocument(Document):
'weekday': fields.IntegerField(attr='weekday'),
'weekday_display': fields.KeywordField(attr='get_weekday_display'),
'closed_at': fields.KeywordField(attr='closed_at_str'),
'opening_at': fields.KeywordField(attr='opening_at_str'),
}
))
address = fields.ObjectField(

View File

@ -39,6 +39,10 @@ class Timetable(ProjectBaseMixin):
def closed_at_str(self):
return str(self.closed_at) if self.closed_at else None
@property
def opening_at_str(self):
return str(self.opening_at) if self.opening_at else None
@property
def opening_time(self):
return self.opening_at or self.lunch_start or self.dinner_start