Implement getting objects by a query criteria

This commit is contained in:
Bo Maryniuk 2016-06-27 16:07:56 +02:00
parent 7623ac6d0a
commit 5db726bdf4

View File

@ -276,6 +276,7 @@ class CsvDB(object):
for t_attr, t_data in zip(header, data): for t_attr, t_data in zip(header, data):
t_attr, t_type = t_attr.split(':') t_attr, t_type = t_attr.split(':')
setattr(_obj, t_attr, self._to_type(t_data, t_type)) setattr(_obj, t_attr, self._to_type(t_data, t_type))
if self.__criteria(_obj, matches=matches, mt=mt, lt=lt, eq=eq):
objects.append(_obj) objects.append(_obj)
return objects return objects