name = Column(String, primary_key=True)
author_email = Column(String, ForeignKey('users.email'))
author = relation(User, backref='documents')


class DocumentsPermissions(Base):
    __tablename__ = 'documents_permissions'
id = Column(Integer, primary_key=True)
readAllowed = Column(Boolean)
writeAllowed = Column(Boolean)
document_name = Column(String, ForeignKey('documents.name'))
document = relation(Document, backref='permissions')
sqlalchemy: как объединить несколько таблиц одним запросом?