Skip to content

Commit b1fdb97

Browse files
authored
fix: support relationships as string (#29)
1 parent 4d541dc commit b1fdb97

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

dataclass_sqlalchemy_mixins/base/mixins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def get_foreign_key_filtered_column(
4747

4848
if related_model:
4949
# Updating original model to continue search
50-
model = related_model.argument
50+
model = related_model.entity.class_
5151
models.append(model)
5252
continue
5353

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "dataclass-sqlalchemy-mixins"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
description = "Allows to convert dataclasses to sqlalchemy filters and orderings."
55
authors = ["ViAchKoN"]
66
readme = "README.md"

tests/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Group(BaseModel):
6666
Owner.id,
6767
),
6868
)
69-
owner = relationship(Owner)
69+
owner = relationship("Owner")
7070

7171
items = relationship("Item", back_populates="group", lazy="dynamic")
7272

0 commit comments

Comments
 (0)