Skip to content

Commit

Permalink
ignore id upon generation
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-1991 committed Jun 9, 2024
1 parent 08f53d6 commit f8eaf5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion templates/python-dataclass.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ from datetime import date, datetime
class {{ object.name }}:

{%- for attribute in object.attributes %}
{%- if attribute.multiple is true %}
{%- if attribute.name == "id" -%}
{%- elif attribute.multiple is true %}
{{ attribute.name }}: List[{{ attribute.dtypes[0] }}] = field(default_factory=list)
{%- elif 'default' in attribute%}
{{ attribute.name }}: {{ attribute.dtypes[0] }} = {{ get_default(attribute.default) }}
Expand Down

0 comments on commit f8eaf5d

Please sign in to comment.