-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Template is here
def __init__(self, data=None, **kwargs):
"""Initialization for the {{Name}} object.
It can be initialized with an object, or by passing each
object property as a keyword argument.
"""
new_data = {}
{%-for propName, propSchema in schema.properties.items()%}
try:
prop = data["{{propName}}"] if ("{{propName}}" in data) else kwargs["{{propName}}"]
The last line should read:
prop = data["{{propName}}"] if (data is not None and "{{propName}}" in data) else kwargs["{{propName}}"]
Otherwise when data is None, it will fail every time.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels