Skip to content

Commit

Permalink
simplified python client and server http templates
Browse files Browse the repository at this point in the history
  • Loading branch information
wkarwacki committed Aug 20, 2024
1 parent 6aa341a commit 94d28e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/gen/python/client/templates/dto.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

{{/each}}

{{key}} ={{>union}} {{else if (and (isAlias val) tl)}}{{key}} = {{fmtType val key}}{{else if (or val.vars adtParent)}}class {{adtParent}}{{fmtClass key}}({{#each (parents val)}}{{#with (resolveIfRef this)}}{{#unless (eq this.type "struct")}}{{>dtoName val=(fmtClass ../path)}}{{#if @last}}{{#if ../adtParent}}, {{/if}}{{else}}, {{/if}}{{else}}{{#if @last}}{{#if ../adtParent}}, {{/if}}{{/if}}{{/unless}}{{/with}}{{/each}}{{#if adtParent}}{{adtParent}}Base{{/if}}{{#unless (or (parents val) adtParent)}}Dto{{/unless}}){{>typeParams val=val}}:
{{key}} ={{>union}} {{else if (and (isAlias val) tl)}}{{key}} = {{fmtType val key}}{{else if (or val.vars adtParent)}}class {{adtParent}}{{fmtClass key}}({{#each (parents val)}}{{#with (resolveIfRef this)}}{{>dtoName val=(fmtClass ../path)}}{{#if @last}}{{#if ../adtParent}}, {{/if}}{{else}}, {{/if}}{{/with}}{{/each}}{{#if adtParent}}{{adtParent}}Base{{/if}}{{#unless (or (parents val) adtParent)}}Dto{{/unless}}){{>typeParams val=val}}:
{{indent}} @classmethod
{{indent}} def get(cls) -> '{{adtParent}}{{key}}':
{{indent}} return {{#with prefix}}{{this}}.{{/with}}{{>stubImpl key=(add adtParent key) val=val adtVar=adtVar indent=(add indent " ")}}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/gen/python/server/templates/dto.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

{{/each}}

{{key}} ={{>union}} {{else if (and (isAlias val) tl)}}{{key}} = {{fmtType val key}}{{else if (or val.vars adtParent)}}class {{adtParent}}{{fmtClass key}}({{#each (parents val)}}{{#with (resolveIfRef this)}}{{#unless (eq this.type "struct")}}{{>dtoName val=(fmtClass ../path)}}{{#if @last}}{{#if ../adtParent}}, {{/if}}{{else}}, {{/if}}{{else}}{{#if @last}}{{#if ../adtParent}}, {{/if}}{{/if}}{{/unless}}{{/with}}{{/each}}{{#if adtParent}}{{adtParent}}Base{{/if}}{{#unless (or (parents val) adtParent)}}Dto{{/unless}}){{>typeParams val=val}}:
{{key}} ={{>union}} {{else if (and (isAlias val) tl)}}{{key}} = {{fmtType val key}}{{else if (or val.vars adtParent)}}class {{adtParent}}{{fmtClass key}}({{#each (parents val)}}{{#with (resolveIfRef this)}}{{>dtoName val=(fmtClass ../path)}}{{#if @last}}{{#if ../adtParent}}, {{/if}}{{else}}, {{/if}}{{/with}}{{/each}}{{#if adtParent}}{{adtParent}}Base{{/if}}{{#unless (or (parents val) adtParent)}}Dto{{/unless}}){{>typeParams val=val}}:
{{indent}} @classmethod
{{indent}} def get(cls) -> '{{adtParent}}{{key}}':
{{indent}} return {{#with prefix}}{{this}}.{{/with}}{{>stubImpl key=(add adtParent key) val=val adtVar=adtVar indent=(add indent " ")}}
Expand Down

0 comments on commit 94d28e4

Please sign in to comment.