| 2281 | fk._set_parent_with_dispatch(self) |
| 2282 | |
| 2283 | def __repr__(self) -> str: |
| 2284 | kwarg = [] |
| 2285 | if self.key != self.name: |
| 2286 | kwarg.append("key") |
| 2287 | if self.primary_key: |
| 2288 | kwarg.append("primary_key") |
| 2289 | if not self.nullable: |
| 2290 | kwarg.append("nullable") |
| 2291 | if self.onupdate: |
| 2292 | kwarg.append("onupdate") |
| 2293 | if self.default: |
| 2294 | kwarg.append("default") |
| 2295 | if self.server_default: |
| 2296 | kwarg.append("server_default") |
| 2297 | if self.comment: |
| 2298 | kwarg.append("comment") |
| 2299 | return "Column(%s)" % ", ".join( |
| 2300 | [repr(self.name)] |
| 2301 | + [repr(self.type)] |
| 2302 | + [repr(x) for x in self.foreign_keys if x is not None] |
| 2303 | + [repr(x) for x in self.constraints] |
| 2304 | + [ |
| 2305 | ( |
| 2306 | self.table is not None |
| 2307 | and "table=<%s>" % self.table.description |
| 2308 | or "table=None" |
| 2309 | ) |
| 2310 | ] |
| 2311 | + ["%s=%s" % (k, repr(getattr(self, k))) for k in kwarg] |
| 2312 | ) |
| 2313 | |
| 2314 | def _set_parent( # type: ignore[override] |
| 2315 | self, |