« ^ »

PynamoDB

所要時間: 約 1分
from pynamodb.attributes import JSONAttribute, UnicodeAttribute, ListAttribute
from pynamodb.models import Model


class Testing(Model):
    class Meta:
        table_name = "testing"
        region = "ap-northeast-1"
        host = "http://localhost:4566"

    code = UnicodeAttribute(hash_key=True)


# test = Testing(code="foo")
# test.save()


class Testing2(Model):
    class Meta:
        table_name = "testing"
        region = "ap-northeast-1"
        host = "http://localhost:4566"

    code = UnicodeAttribute(hash_key=True)
    params = JSONAttribute(default=[])
    params3 = ListAttribute(default=[])


t = Testing2.get("foo")



class Testing3(Model):
    class Meta:
        table_name = "testing"
        region = "ap-northeast-1"
        host = "http://localhost:4566"

    code = UnicodeAttribute(hash_key=True)
    params = JSONAttribute(default=[])
    params3 = ListAttribute(default=list)





class Testing4(Model):
    class Meta:
        table_name = "testing"
        region = "ap-northeast-1"
        host = "http://localhost:4566"

    code = UnicodeAttribute(hash_key=True)
    params = JSONAttribute(default=[])
    params3 = ListAttribute(default=list)
    params5 = ListAttribute()