(const, table)
| 147 | |
| 148 | |
| 149 | def _constraint_name_for_table(const, table): |
| 150 | metadata = table.metadata |
| 151 | convention = _get_convention(metadata.naming_convention, type(const)) |
| 152 | |
| 153 | if isinstance(const.name, conv): |
| 154 | return const.name |
| 155 | elif ( |
| 156 | convention is not None |
| 157 | and not isinstance(const.name, conv) |
| 158 | and ( |
| 159 | const.name is None |
| 160 | or "constraint_name" in convention |
| 161 | or const.name is _NONE_NAME |
| 162 | ) |
| 163 | ): |
| 164 | return conv( |
| 165 | convention |
| 166 | % ConventionDict(const, table, metadata.naming_convention) |
| 167 | ) |
| 168 | elif convention is _NONE_NAME: |
| 169 | return None |
| 170 | |
| 171 | |
| 172 | @event.listens_for( |
no test coverage detected