Fix a lot of missing relationship information, plus some upstream CRUDKit changes.
This commit is contained in:
parent
8643d177ca
commit
cf56baabe2
11 changed files with 82 additions and 22 deletions
|
|
@ -10,7 +10,13 @@ class CRUDMixin:
|
|||
updated_at = Column(DateTime, default=func.now(), onupdate=func.now())
|
||||
|
||||
def as_dict(self):
|
||||
return {c.name: getattr(self, c.name) for c in self.__table__.columns}
|
||||
# Combine all columns from all inherited tables
|
||||
result = {}
|
||||
for cls in self.__class__.__mro__:
|
||||
if hasattr(cls, "__table__"):
|
||||
for column in cls.__table__.columns:
|
||||
result[column.name] = getattr(self, column.name)
|
||||
return result
|
||||
|
||||
class Version(Base):
|
||||
__tablename__ = "versions"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue