Skip to content

Commit

Permalink
updating Piccolo syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
dantownsend committed Oct 29, 2019
1 parent 4146ab3 commit fb6f14f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions piccolo_api/crud/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ def __init__(self, table: Table, read_only: bool = True) -> None:
@property
def pydantic_model(self):
columns: t.Dict[str, t.Any] = {}
for i in self.table._meta.non_default_columns:
if type(i) == ForeignKey:
columns[i._name] = pydantic.Schema(
for column in self.table._meta.non_default_columns:
if type(column) == ForeignKey:
columns[column._meta.name] = pydantic.Schema(
default=0,
foreign_key=True,
to=i.references._meta.tablename
to=column.references._meta.tablename
)
else:
columns[i._name] = (
i.value_type,
columns[column._meta.name] = (
column.value_type,
None
)

Expand Down

0 comments on commit fb6f14f

Please sign in to comment.