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?