def from_hash(self, obj):
     """Convert the hash into the object."""
     super(TransactionKeyValue, self).from_hash(obj)
     if 'transaction_id' in obj:
         self.transaction = Transactions.get(Transactions.id == obj['transaction_id'])
     if 'value_id' in obj:
         self.value = Values.get(Values.id == obj['value_id'])
     if 'key_id' in obj:
         self.key = Keys.get(Keys.id == obj['key_id'])
示例#2
0
 def from_hash(self, obj):
     """Convert the hash into the object."""
     super(FileKeyValue, self).from_hash(obj)
     if 'file_id' in obj:
         self.file = Files.get(Files.id == obj['file_id'])
     if 'key_id' in obj:
         self.key = Keys.get(Keys.id == obj['key_id'])
     if 'value_id' in obj:
         self.value = Values.get(Values.id == obj['value_id'])
 def from_hash(self, obj):
     """
     Converts the hash into the object
     """
     super(TransactionKeyValue, self).from_hash(obj)
     if 'transaction_id' in obj:
         self.transaction = Transactions.get(Transactions.id == obj['transaction_id'])
     if 'value_id' in obj:
         self.value = Values.get(Values.id == obj['value_id'])
     if 'key_id' in obj:
         self.key = Keys.get(Keys.id == obj['key_id'])
 def from_hash(self, obj):
     """
     Converts the hash into the object
     """
     super(FileKeyValue, self).from_hash(obj)
     if 'file_id' in obj:
         self.file = Files.get(Files.id == obj['file_id'])
     if 'key_id' in obj:
         self.key = Keys.get(Keys.id == obj['key_id'])
     if 'value_id' in obj:
         self.value = Values.get(Values.id == obj['value_id'])
 def where_clause(self, kwargs):
     """Where clause for the various elements."""
     where_clause = super(TransactionKeyValue, self).where_clause(kwargs)
     if 'transaction_id' in kwargs:
         trans = Transactions.get(Transactions.id == kwargs['transaction_id'])
         where_clause &= Expression(TransactionKeyValue.transaction, OP.EQ, trans)
     if 'key_id' in kwargs:
         key = Keys.get(Keys.id == kwargs['key_id'])
         where_clause &= Expression(TransactionKeyValue.key, OP.EQ, key)
     if 'value_id' in kwargs:
         value = Values.get(Values.id == kwargs['value_id'])
         where_clause &= Expression(TransactionKeyValue.value, OP.EQ, value)
     return where_clause
示例#6
0
 def where_clause(self, kwargs):
     """Where clause for the various elements."""
     where_clause = super(FileKeyValue, self).where_clause(kwargs)
     if 'file_id' in kwargs:
         file_ = Files.get(Files.id == kwargs['file_id'])
         where_clause &= Expression(FileKeyValue.file, OP.EQ, file_)
     if 'key_id' in kwargs:
         key = Keys.get(Keys.id == kwargs['key_id'])
         where_clause &= Expression(FileKeyValue.key, OP.EQ, key)
     if 'value_id' in kwargs:
         value = Values.get(Values.id == kwargs['value_id'])
         where_clause &= Expression(FileKeyValue.value, OP.EQ, value)
     return where_clause
 def where_clause(self, kwargs):
     """
     Where clause for the various elements.
     """
     where_clause = super(TransactionKeyValue, self).where_clause(kwargs)
     if 'transaction_id' in kwargs:
         trans = Transactions.get(Transactions.id == kwargs['transaction_id'])
         where_clause &= Expression(TransactionKeyValue.transaction, OP.EQ, trans)
     if 'key_id' in kwargs:
         key = Keys.get(Keys.id == kwargs['key_id'])
         where_clause &= Expression(TransactionKeyValue.key, OP.EQ, key)
     if 'value_id' in kwargs:
         value = Values.get(Values.id == kwargs['value_id'])
         where_clause &= Expression(TransactionKeyValue.value, OP.EQ, value)
     return where_clause
 def where_clause(self, kwargs):
     """
     Where clause for the various elements.
     """
     where_clause = super(FileKeyValue, self).where_clause(kwargs)
     if 'file_id' in kwargs:
         file_ = Files.get(Files.id == kwargs['file_id'])
         where_clause &= Expression(FileKeyValue.file, OP.EQ, file_)
     if 'key_id' in kwargs:
         key = Keys.get(Keys.id == kwargs['key_id'])
         where_clause &= Expression(FileKeyValue.key, OP.EQ, key)
     if 'value_id' in kwargs:
         value = Values.get(Values.id == kwargs['value_id'])
         where_clause &= Expression(FileKeyValue.value, OP.EQ, value)
     return where_clause