-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
Hi!
There is a problem with ListAttribute():
from pynamodb.models import Model
from marshmallow_pynamodb import ModelSchema
class User(Model):
nick_names = ListAttribute()
class UserSchema(ModelSchema):
class Meta:
model = User/marshmallow_pynamodb/schema.py", line 39, in get_declared_fields
element_type = type(attribute.element_type.__name__, (ModelSchema, ), {'Meta': Meta})
AttributeError: 'NoneType' object has no attribute '__name__'
It is understandable that is not so much sense for schema with list without type specification but it is valid model and possible use case.
So it seems two way to handle this issue. First option is forbid create list attribute without specifying type and second is handle this situation and create schema and validate only container type.