init
This commit is contained in:
11
app/models/article.py
Normal file
11
app/models/article.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from app import db
|
||||
|
||||
class Article(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
url = db.Column(db.String(2000), unique=True)
|
||||
title = db.Column(db.String(2000))
|
||||
raw_content = db.Column(db.Text)
|
||||
debloated_content = db.Column(db.Text)
|
||||
summarized_content = db.Column(db.Text)
|
||||
|
||||
site_id = db.Column(db.Integer, db.ForeignKey('site.id'))
|
5
app/models/category.py
Normal file
5
app/models/category.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from . import db
|
||||
|
||||
class Category(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(255), unique=True)
|
11
app/models/site.py
Normal file
11
app/models/site.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from app import db
|
||||
from app.models.article import Article
|
||||
|
||||
class Site(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(255))
|
||||
base_url = db.Column(db.String(1000), unique=True)
|
||||
feed_url = db.Column(db.String(1000), unique=True)
|
||||
articles = db.relationship('Article', backref='site')
|
||||
# TODO add creation date
|
||||
# TODO add last_updated date
|
Reference in New Issue
Block a user