-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
Hi.
I'm trying to use the package but I have a lot of fields in python mapped to fields named differently in Dynamo (using the attr_name).
Each of those fields results in a None value when serializing it, and in addition it uses the attr_name instead of the field name.
Example:
class Result(Model):
app_id = NumberAttribute(attr_name="appId")
domain = UnicodeAttribute()
class ResultSchema(ModelSchema):
class Meta:
model = Result
result = Result(app_id=5, domain='a.com')
ResultSchema().dump(result).data
>>> {'domain': 'a.com', 'appId': None}
Expected:
{'domain': 'a.com', 'app_id': 5}
Changing the model's attributes to the original attribute names is not an option as part of them have symbols that are not supported by python as valid names (appId#version for example)
Thanks
Reactions are currently unavailable