我正在尝试使用pynamodb创建这个表:

这是我为OrgModel准备的:
TABLE_NAME = 'OrgsAndUsers'
class OrgModel(Model):
class Meta:
table_name = TABLE_NAME
region = 'us-east-1'
OrgName = UnicodeAttribute(hash_key=True, range_key=True)
SubscriptionLevel = UnicodeAttribute()如何对用户对象建模?如何将OrgModel设置为用户的分区键?
pynamodb是用python进行dynamodb编程的好包吗?
发布于 2020-10-04 10:50:16
我认为你想要做的是
class UserModel(Model):
class Meta:
table_name = 'OrgsAndUsers'
region = 'us-east-1'
org_name = UnicodeAttribute(hash_key=True)
user_name = UnicodeAttribute(range_key=True)
subscription_level = UnicodeAttribute()
role = UnicodeAttribute()https://stackoverflow.com/questions/63828119
复制相似问题