I am having trouble getting the JSON representation from PynamoDB instance. Here is the Model.
class MyTest(Model):
"""
Model class representing the Golden table attributes.
"""
class Meta:
table_name = "my-test"
# Query Fields
Id = UnicodeAttribute(hash_key=True)
SomeInfo = MapAttribute(default={})
SomeInfo1 = UnicodeAttribute(null=True)
my_test = MyTest(Id='123', SomeInfo={}, SomeInfo1='testing')
What I need is JSON representation of my_test.
Things I have tried are.
my_test.to_dict() - This gave a non attribute error
json.dumps(my_test.to_dict(), indent=2)
Any help would be appreciated.