You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Template is here
The last line should read:
Otherwise when data is None, it will fail every time.
The text was updated successfully, but these errors were encountered: