Minor cli.py refactoring.

This commit is contained in:
crudo 2017-03-24 19:39:05 +01:00
parent c07c19ca32
commit 5db877dc4c

8
cli.py
View File

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