Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class Collection(db.Model):
content = db.relationship('Content', backref='collection', lazy='dynamic', cascade='all, delete-orphan')
def has_content(self, url):
return self.content.filter_by(url=url).first() is not None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.