Skip to content

Instantly share code, notes, and snippets.

@Porter97
Created February 13, 2020 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Porter97/53453a72eece66f8567d58590f23e526 to your computer and use it in GitHub Desktop.
Save Porter97/53453a72eece66f8567d58590f23e526 to your computer and use it in GitHub Desktop.
#...
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