Social News in 1000 Steps – Step 14

This entry is part 14 of 14 in the series Social News

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 …

Series NavigationSocial News in 1000 Steps – Step 13
By the author of NumPy Beginner's Guide, NumPy Cookbook and Instant Pygame. If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.
This entry was posted in programming and tagged . Bookmark the permalink.