Skip to content

Commit

Permalink
Work around wrong class names
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Bulash committed May 27, 2015
1 parent 2d4ee3b commit 6efab08
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions flask_swagger_codegen/templates/models.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

# models are for SQL-alchemy

from marshmallow import fields
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()

Expand All @@ -14,7 +13,7 @@ db = SQLAlchemy()

class {{ name }}(db.Model):
{%- for n, field in schema.fields.iteritems() %}
{{n}} = db.Column(db.{{ field }})
{{n}} = db.Column(db.{{ field | replace('fields.', '') }})
{%- endfor %}

{%- endfor %}
Expand Down

0 comments on commit 6efab08

Please sign in to comment.