-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
37 lines (28 loc) · 1019 Bytes
/
models.py
File metadata and controls
37 lines (28 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, DateTime
from sqlalchemy.orm import relationship
from database import Base
class User(Base):
__tablename__ = "user"
id = Column(Integer, primary_key=True, index=True)
email = Column(String, unique=True, index=True)
hashed_password = Column(String)
is_active = Column(Boolean, default=True)
class Rss(Base):
__tablename__ = "rss"
id = Column(Integer, primary_key=True, index=True)
url_rss = Column(String, index=True)
title = Column(String)
user_id = Column(Integer, ForeignKey('user.id'))
user = relationship("User")
class Feed(Base):
__tablename__ = "feed"
id = Column(Integer, primary_key=True, index=True)
title = Column(String)
summary = Column(String)
published = Column(DateTime)
image = Column(String)
author = Column(String)
link = Column(String)
id_feed = Column(String)
rss_id = Column(Integer, ForeignKey('rss.id'))
rss = relationship("Rss")