<s> from django . db import models <EOL> from . dict import HStoreDict , HStoreReferenceDict <EOL> __all__ = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] <EOL> class HStoreDescriptor ( models . fields . subclassing . Creator ) : <EOL> _DictClass = HStoreDict <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> self . schema_mode = kwargs . pop ( '<STR_LIT>' , False ) <EOL> super ( HStoreDescriptor , self ) . __init__ ( * args , ** kwargs ) <EOL> def __set__ ( self , obj , value ) : <EOL> value = self . field . to_python ( value ) <EOL> if isinstance ( value , dict ) : <EOL> value = self . _DictClass ( <EOL> value = value , field = self . field , instance = obj , schema_mode = self . schema_mode <EOL> ) <EOL> obj . __dict__ [ self . field . name ] = value <EOL> class SerializedDictDescriptor ( models . fields . subclassing . Creator ) : <EOL> _DictClass = dict <EOL> def __set__ ( self , obj , value ) : <EOL> if value and self . field . _from_db ( obj ) : <EOL> value = self . field . to_python ( value ) <EOL> obj . __dict__ [ self . field . name ] = value <EOL> class HStoreReferenceDescriptor ( HStoreDescriptor ) : <EOL> _DictClass = HStoreReferenceDict </s>
