where.py 661 Bytes
Newer Older
1
class Where:
Gerion Entrup's avatar
Gerion Entrup committed
2
3
    """Represents a where query."""

4
    def __init__(self, function, ph_obj, attribute):
Gerion Entrup's avatar
Gerion Entrup committed
5
6
7
8
9
10
11
12
13
14
15
16
        """Constructs a where query.

        Arguments:
        function  -- the function of a table that should be used.
        ph_obj    -- the placeholder name of the comparator object.
        attribute -- the attribute name of the placeholder object.

        Example:
        Assume you want to do the query '.where(Artist.gid = <artist>.gid)',
        then you construct this object with
        Where(Artist.gid.__eq__, '<artist>', 'gid')
        """
17
18
19
        self.function = function
        self.ph_obj = ph_obj
        self.attribute = attribute