Minor template refactor and cli.py user interface enhancement #5

Closed
subnixr wants to merge 15 commits from (deleted):cosette into master
Showing only changes of commit 5db877dc4c - Show all commits

10
cli.py
View File

@ -99,15 +99,15 @@ def tabulate_events(events):
def get_overlapping_events(session, starts_at, ends_at): def get_overlapping_events(session, starts_at, ends_at):
q = session.query(Event) events = session.query(Event)
if ends_at is None: if ends_at is None:
q = q.filter(Event.starts_at <= starts_at) events = events.filter(Event.starts_at <= starts_at)
else: else:
q = q.filter(Event.ends_at >= starts_at)\ events = events.filter(Event.ends_at >= starts_at)\
.filter(Event.starts_at <= ends_at) .filter(Event.starts_at <= ends_at)
return q.all() return events.all()
@event.command('add') @event.command('add')