| 2555 | fk._set_parent_with_dispatch(self) |
| 2556 | |
| 2557 | def __repr__(self) -> str: |
| 2558 | kwarg = [] |
| 2559 | if self.key != self.name: |
| 2560 | kwarg.append("key") |
| 2561 | if self.primary_key: |
| 2562 | kwarg.append("primary_key") |
| 2563 | if not self.nullable: |
| 2564 | kwarg.append("nullable") |
| 2565 | if self.onupdate: |
| 2566 | kwarg.append("onupdate") |
| 2567 | if self.default: |
| 2568 | kwarg.append("default") |
| 2569 | if self.server_default: |
| 2570 | kwarg.append("server_default") |
| 2571 | if self.comment: |
| 2572 | kwarg.append("comment") |
| 2573 | return "Column(%s)" % ", ".join( |
| 2574 | [repr(self.name)] |
| 2575 | + [repr(self.type)] |
| 2576 | + [repr(x) for x in self.foreign_keys if x is not None] |
| 2577 | + [repr(x) for x in self.constraints] |
| 2578 | + [ |
| 2579 | ( |
| 2580 | self.table is not None |
| 2581 | and "table=<%s>" % self.table.description |
| 2582 | or "table=None" |
| 2583 | ) |
| 2584 | ] |
| 2585 | + ["%s=%s" % (k, repr(getattr(self, k))) for k in kwarg] |
| 2586 | ) |
| 2587 | |
| 2588 | def _set_parent( # type: ignore[override] |
| 2589 | self, |