I have the following SQLAlchemy model:
class PersonConsent(ModelAbstract):
__tablename__ = "personConsent"
id = db.Column(db.Integer, primary_key=True)
patientId = db.Column(db.Integer, db.ForeignKey("person.id"))
authorizedPersonId = db.Column(db.Integer, db.ForeignKey("person.id"))
attachmentId = db.Column(db.Integer)
# Additional models
authorizedPerson = db.relationship("Person", foreign_keys=[authorizedPersonId])
consents = db.relationship("PersonConsentType",
secondary=personConsentToTypeMap,
primaryjoin=id==personConsentToTypeMap.c.consentId,
secondaryjoin=PersonConsentType.id==personConsentToTypeMap.c.consentTypeId)
Given just the PersonConsent model how do I determine the model of items that make up the consents field?
For example, something like
type(PersonConsent.consents) == PersonConsentType