for arg, val in list(kwargs.items()):
    if '__contains' in arg:
        contains.append((arg.split('__')[0], val))
else:
    keywordargs[arg] = val
result = []
if len(contains) > 0:
    for entry in super(UserFeedManager, self).filter(*args, **keywordargs):
        if all(map(lambda attr_val: attr_val[1] in entry.__getattribute__(attr_val[0]),
            contains)):
            result.append(entry)
else:
    result = super(UserFeedManager, self).filter(*args, **keywordargs)
return result
How to implement Django like 'contains' filter query with Google App Engine?