def __init__(self, **kwargs):                  
        """ constructor """
        
        self._tablename = self.__class__._tablename
        if self._tablename == '':
            self._tablename = self.__class__.__name__
        self._dateformat = self.__class__._dateformat
        self._datetimeformat = self.__class__._datetimeformat
        self._exists = None
        self._encrypt = []

        IncludeRelationship = []
               
        """ parse **kwargs into instance var """
        for key, default in vars(self.__class__).items():
            if not key.startswith('_') and key != '':

                to_type = type(default)
                
                if to_type is PartitionKey:
                    self._PartitionKey = key
                    to_type = default._type
                    default = default._default

                elif to_type is RowKey:
                    self._RowKey = key
                    to_type = default._type
                    default = default._default

                elif to_type is EncryptKey:
                    self._encrypt.append(key)
                    to_type = default._type
                    default = default._default

                value = kwargs.get(key, default)
                
                if to_type is StorageTableQuery:
                    setattr(self, key, value)
                    IncludeRelationship.append({'key': key, 
                                                'query': value})

                elif to_type is datetime.datetime:
                    setattr(self, key, safe_cast(value, to_type, default, self._datetimeformat))

                elif to_type is datetime.date:
                    setattr(self, key, safe_cast(value, to_type, default, self._dateformat))

                else:
                    setattr(self, key, safe_cast(value, to_type, default))

        """ initialize Relationship/ related Query Objects """
        for item in IncludeRelationship:
            key = item['key']
            query = item['query']
            pkwhere = getattr(self, query._pkforeignkey, '*')
            rkwhere = getattr(self, query._rkforeignkey, '*') 
            setattr(self, key, StorageTableQuery(query._storagemodel,
                                                 query._pkcondition,
                                                 pkwhere,
                                                 query._rkcondition,
                                                 rkwhere))
def __init__ ( self , ** kwargs ) : self . _tablename = self . __class__ . _tablename if self . _tablename == '' : self . _tablename = self . __class__ . __name__ self . _dateformat = self . __class__ . _dateformat self . _datetimeformat = self . __class__ . _datetimeformat self . _exists = None self . _encrypt = [ ] IncludeRelationship = [ ] """ parse **kwargs into instance var """ for key , default in vars ( self . __class__ ) . items ( ) : if not key . startswith ( '_' ) and key != '' : to_type = type ( default ) if to_type is PartitionKey : self . _PartitionKey = key to_type = default . _type default = default . _default elif to_type is RowKey : self . _RowKey = key to_type = default . _type default = default . _default elif to_type is EncryptKey : self . _encrypt . append ( key ) to_type = default . _type default = default . _default value = kwargs . get ( key , default ) if to_type is StorageTableQuery : setattr ( self , key , value ) IncludeRelationship . append ( { 'key' : key , 'query' : value } ) elif to_type is datetime . datetime : setattr ( self , key , safe_cast ( value , to_type , default , self . _datetimeformat ) ) elif to_type is datetime . date : setattr ( self , key , safe_cast ( value , to_type , default , self . _dateformat ) ) else : setattr ( self , key , safe_cast ( value , to_type , default ) ) """ initialize Relationship/ related Query Objects """ for item in IncludeRelationship : key = item [ 'key' ] query = item [ 'query' ] pkwhere = getattr ( self , query . _pkforeignkey , '*' ) rkwhere = getattr ( self , query . _rkforeignkey , '*' ) setattr ( self , key , StorageTableQuery ( query . _storagemodel , query . _pkcondition , pkwhere , query . _rkcondition , rkwhere ) )
constructor