def index():
interval = db().select(db.t_admission_schedule.BEGINNING,db.t_admission_schedule.END_APP,orderby=~db.t_admission_schedule.END_APP).first()
if ((datetime.datetime.now().date()>=interval.BEGINNING) & (datetime.datetime.now().date()<interval.END_APP))
...
else:
text = DIV(
XML('<h4 class="text-center" style="text-transform:uppercase">До старта приёмной кампании осталось:</h4>')
)
delta = datetime.datetime(interval.BEGINNING.year,interval.BEGINNING.month,interval.BEGINNING.day,0,0) - datetime.datetime.now()
seconds = delta.total_seconds()
return dict(text=text,seconds=seconds)