Social News in 1000 Steps – Step 14

I added a table to exclude domains specified by the user. The model and view are as follows:

class ExcludeDomain(db.Model):
    __tablename__ = 'exclude_domains'
 
    id = db.Column(db.Integer, primary_key=True)
    added = db.Column(db.DateTime, default=datetime.utcnow)
    url = db.Column(db.Text, unique=True)
 
 
class ExcludeDomainAdmin(sqla.ModelView):
    form_excluded_columns = ['added']
 
admin.add_view(ExcludeDomainAdmin(ExcludeDomain, db.session))

P.S: If anyone wants code or data, please contact the support department. Some stuff is available on GitHub, DockerHub and PyPi …

Share
Posted in programming | Tagged | Comments Off on Social News in 1000 Steps – Step 14