File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 2
2
PynamoDB attributes
3
3
"""
4
4
import six
5
- from six import add_metaclass
6
5
import json
7
6
from base64 import b64encode , b64decode
8
7
from datetime import datetime
@@ -102,7 +101,6 @@ def _get_attribute_value(self, value):
102
101
103
102
class AttributeContainer (object ):
104
103
105
- _attributes = None
106
104
_dynamo_to_python_attrs = None
107
105
108
106
@classmethod
@@ -137,7 +135,8 @@ def _get_attributes(cls):
137
135
138
136
:rtype: dict[str, Attribute]
139
137
"""
140
- if cls ._attributes is None :
138
+ if '_attributes' not in cls .__dict__ :
139
+ # Each subclass of AttributeContainer needs its own attributes map.
141
140
cls ._initialize_attributes ()
142
141
return cls ._attributes
143
142
@@ -445,12 +444,6 @@ def deserialize(self, value):
445
444
return None
446
445
447
446
448
- class MapAttributeMeta (type ):
449
- def __init__ (cls , name , bases , attrs ):
450
- setattr (cls , '_attributes' , None )
451
-
452
-
453
- @add_metaclass (MapAttributeMeta )
454
447
class MapAttribute (AttributeContainer , Attribute ):
455
448
attr_type = MAP
456
449
You can’t perform that action at this time.
0 commit comments