Created
August 7, 2022 03:18
-
-
Save thanakijwanavit/59a02dda15456f3a2f9d9c94f7ba6f2d to your computer and use it in GitHub Desktop.
pynamodbOverride override init for pynamodb example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#export | |
from nicHelper.pynamodb import SuperModel | |
from pynamodb.attributes import JSONAttribute, NumberAttribute, UnicodeAttribute | |
class PaymentRecordTable(SuperModel): | |
data = JSONAttribute(null=True) | |
timestamp = NumberAttribute(hash_key=True) | |
userId = UnicodeAttribute() | |
def __init__(self, hash_key=None, range_key=None, _user_instantiated=True, **kwargs): | |
super().__init__(hash_key=hash_key, range_key=range_key, _user_instantiated=_user_instantiated, **kwargs) | |
self.timestamp = datetime.now().timestamp() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment