diff --git a/requirements.txt b/requirements.txt index a4fe7e2..42cac36 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ aiohttp_jinja2 aiohttp sqlalchemy logbook +psycopg2-binary diff --git a/wallabag_kindle_consumer/consumer.py b/wallabag_kindle_consumer/consumer.py index d11f92c..27e1b2e 100644 --- a/wallabag_kindle_consumer/consumer.py +++ b/wallabag_kindle_consumer/consumer.py @@ -60,7 +60,7 @@ class Consumer: await asyncio.gather(*fetches) session.commit() - jobs = [self.process_job(job, session) for job in session.query(Job).options(joinedload('user'))] + jobs = [self.process_job(job, session) for job in session.query(Job).options(joinedload(Job.user))] await asyncio.gather(*jobs) session.commit() diff --git a/wallabag_kindle_consumer/models.py b/wallabag_kindle_consumer/models.py index 558b7a2..237a4cf 100644 --- a/wallabag_kindle_consumer/models.py +++ b/wallabag_kindle_consumer/models.py @@ -28,8 +28,8 @@ class Job(Base): id = Column(Integer, primary_key=True, autoincrement=True) article = Column(Integer) title = Column(String) - user_name = Column(Integer, ForeignKey("user.name")) - format = Column(Enum('pdf', 'mobi', 'epub')) + user_name = Column(String, ForeignKey("user.name")) + format = Column(Enum('pdf', 'mobi', 'epub', name='format_enum')) class ContextSession: