Skip to content

Commit

Permalink
many refs fixed uuid ref
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaDaniel committed Aug 6, 2024
1 parent e295c93 commit b1336c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bo4e_generator/custom_templates/ManyLinks.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class {{class1}}{{class2[1]}}Link(SQLModel, table=True):
"""
class linking m-n relation of tables {{class1}} and {{class2[0]}} for field {{ class2[1]}}.
"""
{{class1.lower()}}_id: Optional[uuid_pkg.UUID] = Field(sa_column=Column(UUID(as_uuid=True), ForeignKey("{{class1.lower()}}.{{class1.lower()}}_sqlid", ondelete="CASCADE"), primary_key=True))
{{class2[0].lower()}}_id: Optional[uuid_pkg.UUID] = Field(sa_column=Column(UUID(as_uuid=True), ForeignKey("{{class2[0].lower()}}.{{class2[0].lower()}}_sqlid", ondelete="CASCADE"), primary_key=True))
{{class1.lower()}}_id: Optional[uuid_pkg.UUID] = Field(sa_column=Column(UUID(as_uuid=True), ForeignKey("{{class1.lower()}}.id", ondelete="CASCADE"), primary_key=True))
{{class2[0].lower()}}_id: Optional[uuid_pkg.UUID] = Field(sa_column=Column(UUID(as_uuid=True), ForeignKey("{{class2[0].lower()}}.id", ondelete="CASCADE"), primary_key=True))

{%- endfor -%}
{%- endfor -%}

0 comments on commit b1336c2

Please sign in to comment.