Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def item(self, item_key, item_value=None):
if item_value is not None:
return DictionaryItem.upsert(self.conn, {
'service_id': self.attrs['service_id'],
'dictionary_id': self.attrs['id'],
'item_key': item_key,
'item_value': item_value,
})
return DictionaryItem.find(self.conn, service_id=self.attrs['service_id'], dictionary_id=self.attrs['id'], item_key=item_key)