Retrieves primary key sqlalchemy column from models OrmarConfig.table. Each model has to have primary key. Only one primary key column is allowed. :return: primary key sqlalchemy column :rtype: sqlalchemy.Column
(self)
| 565 | |
| 566 | @property |
| 567 | def pk_column(self) -> sqlalchemy.Column: |
| 568 | """ |
| 569 | Retrieves primary key sqlalchemy column from models OrmarConfig.table. |
| 570 | Each model has to have primary key. |
| 571 | Only one primary key column is allowed. |
| 572 | |
| 573 | :return: primary key sqlalchemy column |
| 574 | :rtype: sqlalchemy.Column |
| 575 | """ |
| 576 | if object.__getattribute__(self, "_pk_column") is not None: |
| 577 | return object.__getattribute__(self, "_pk_column") |
| 578 | pk_columns = self.ormar_config.table.primary_key.columns.values() |
| 579 | pk_col = pk_columns[0] |
| 580 | object.__setattr__(self, "_pk_column", pk_col) |
| 581 | return pk_col |
| 582 | |
| 583 | @property |
| 584 | def saved(self) -> bool: |
nothing calls this directly
no test coverage detected