diff options
Diffstat (limited to 'quarg/database')
-rw-r--r-- | quarg/database/filters.py | 4 | ||||
-rw-r--r-- | quarg/database/tables.py | 18 |
2 files changed, 13 insertions, 9 deletions
diff --git a/quarg/database/filters.py b/quarg/database/filters.py index a78b117..75142ac 100644 --- a/quarg/database/filters.py +++ b/quarg/database/filters.py @@ -1,6 +1,8 @@ -from sqlalchemy.sql.expression import or_, between +from sqlalchemy.sql.expression import between, or_ + from quarg.database.tables import Backlog, Buffer, Network, QuasselUser, Sender + def msg_like(query): return Backlog.message.like(query, escape='\\') diff --git a/quarg/database/tables.py b/quarg/database/tables.py index 6e92c14..c71cedd 100644 --- a/quarg/database/tables.py +++ b/quarg/database/tables.py @@ -1,19 +1,21 @@ import datetime +from sqlalchemy.orm import declarative_base, relationship from sqlalchemy.schema import Column, ForeignKey -from sqlalchemy.types import BigInteger, Boolean, DateTime, Integer, Text, TypeDecorator, TypeEngine -from sqlalchemy.ext.declarative import declarative_base -from sqlalchemy.orm import relationship +from sqlalchemy.types import ( + BigInteger, + Boolean, + DateTime, + Integer, + Text, + TypeDecorator, + TypeEngine, +) -# pylint: disable=too-few-public-methods # Timestamps are saved in the database in UTC without timezone info, so attach # a UTC timezone to the datetime object class DateTimeUTC(TypeDecorator): - # pylint complains that process_literal_param and python_type are - # abstract but not overriden. This seems to not be necessary with - # SQLAlchemy, so squash those warnings - # pylint: disable=abstract-method impl = TypeEngine cache_ok = True |