python - SQLAlchemy - Mapper configuration and declarative base -
I am writing backend in a multimedia archive database and I want to use the Joining Heritage Table, I declare SQLLame I'm using Python with. The table containing the media record is as follows:
_Base = declarative_base () class records (_Base): __tablename__ = 'records' item_id = column (string (M_ITIIID), foreigner (' item id 'String (M_RECORD_URI)) type = column (string (' strings')) ID = column (string (M_RECORD_ID), primary_key = true) uri = column (string (M_RECORD_URI)); storage_ID = column (string (M_STORAGE_ID), foreign key ('storages.id') M_RECORD_TYPE) name = column (string (M_RECORD_NAME)) column type is a discriminant I now I want to define a udioRecord by the record class, but I do not want to use the declarative syntax to set the polymorphic mapper . I am looking for the following code (from SQLite documentation):
Mapper (record, record, polymorphic_on = record, type polymorphic permissions = 'record') Mapper (audiocard, Audiorecords , Inherits = record, polymorphic_identity = 'audio_record') How can I get polymorphic_on , polymorphic_idti and
You Jane
Finally got the answer in the manual.
Comments
Post a Comment