From 5db877dc4c2b851a2209150f1c8f00b9a000ff6f Mon Sep 17 00:00:00 2001 From: crudo Date: Fri, 24 Mar 2017 19:39:05 +0100 Subject: [PATCH] Minor cli.py refactoring. --- cli.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cli.py b/cli.py index 61ab867..00bc4c0 100755 --- a/cli.py +++ b/cli.py @@ -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)\ - .filter(Event.starts_at <= ends_at) + events = events.filter(Event.ends_at >= starts_at)\ + .filter(Event.starts_at <= ends_at) - return q.all() + return events.all() @event.command('add')