Closed pythononwheels closed 6 years ago
Works. Tested with tinydb.
a=Alist()
print(a)
{ 'created_at': datetime.datetime(2018, 8, 28, 14, 38, 57, 42390), 'id': '', 'last_updated': datetime.datetime(2018, 8, 28, 14, 38, 57, 42390), 'tags': [], 'text': '', 'title': '', 'votes': 0}
a.tags.append(1)
print(a.tags)
[1]
So lists need an explicit "default" : [] in the model definition:
see line:
'tags' : { 'type': 'list', "default" : [] },