Closed kumy closed 7 years ago
what about specifying attribute in schema?
http://marshmallow.readthedocs.io/en/latest/quickstart.html#specifying-attribute-names
This was my first idea, but it only permit to rename the field on Json dump level. All models and accesses will be burden by foreign languages strings. Renaming field as soon as possible (in model definition) will give a central point to update later when the old application will be dismantled, and databases fields renamed.
I'm rewriting an old application where tables and columns names are in a foreign language. I would like to translate all to English as soon as possible in the code and limit use of non-english in the code. I also want to fix some inconsistencies in columns names.
First idea was to transform:
to
but it raise:
Exception: User has no attribute userid
Adding
key='id'
has no effect. (id = db.Column('userid', db.Integer, primary_key=True, key='id')
)I'll propose a PR for that.