'Returns the rows that match the given constraints (using equals + AND):'

def filter(self, *args, **kwargs):

    if (len(args) == 0):
        fields = ALL
    elif ((len(args) == 1) and (not isinstance(args[0], dict))):
        fields = args[0]
    elif (len(args) == 1):
        (fields, kwargs) = (ALL, args[0])
    elif (len(args) >= 2):
        (fields, kwargs) = (args[0], args[1])
    fields = ((isinstance(fields, (list, tuple)) and ',    '.join(fields)) or fields or ALL)
    q = '    and    '.join((cmp(k, v, '=', self.db.escape) for (k, v) in kwargs.items()))
    q = ((q and ('    where    %s' % q)) or '')
    q = ('select    %s    from    `%s`%s;' % (fields, self.name, q))
    return self.Rows(self, self.db.execute(q))
