random pep8

pull/6/head
bobloy 7 years ago
parent 3f331e2016
commit c42ba7cc8c

@ -149,11 +149,7 @@ class Statement(StatementMixin):
:returns: A dictionary representation of the statement object.
:rtype: dict
"""
data = {}
data['text'] = self.text
data['in_response_to'] = []
data['extra_data'] = self.extra_data
data = {'text': self.text, 'in_response_to': [], 'extra_data': self.extra_data}
for response in self.in_response_to:
data['in_response_to'].append(response.serialize())
@ -212,11 +208,6 @@ class Response(object):
return self.text == other
def serialize(self):
data = {}
data['text'] = self.text
data['created_at'] = self.created_at.isoformat()
data['occurrence'] = self.occurrence
data = {'text': self.text, 'created_at': self.created_at.isoformat(), 'occurrence': self.occurrence}
return data

@ -183,7 +183,7 @@ class SQLStorageAdapter(StorageAdapter):
if isinstance(_filter, list):
if len(_filter) == 0:
_query = _response_query.filter(
Statement.in_response_to == None # NOQA Here must use == instead of is
Statement.in_response_to is None # NOQA Here must use == instead of is
)
else:
for f in _filter:
@ -193,7 +193,7 @@ class SQLStorageAdapter(StorageAdapter):
if fp == 'in_response_to__contains':
_query = _response_query.join(Response).filter(Response.text == _filter)
else:
_query = _response_query.filter(Statement.in_response_to == None) # NOQA
_query = _response_query.filter(Statement.in_response_to is None) # NOQA
else:
if _query:
_query = _query.filter(Response.statement_text.like('%' + _filter + '%'))

Loading…
Cancel
Save