@@ -83,38 +83,6 @@ def __init__(self,
8383 self ._order = list (order )
8484 self ._group_by = list (group_by )
8585
86- def clone (self , ** kw ):
87- """Create a new Query, copying self,
88-
89- :type kw: dict, name->value.
90- :param kw: Replace properties in the copied query with those specified
91- in ``kw``.
92-
93- :rtype: :class:`gcloud.datastore.query.Query`
94- """
95- kind = kw .pop ('kind' , self ._kind )
96- dataset = kw .pop ('dataset' , self ._dataset )
97- namespace = kw .pop ('namespace' , self ._namespace )
98- ancestor = kw .pop ('ancestor' , self ._ancestor )
99- filters = kw .pop ('filters' , self ._filters )
100- projection = kw .pop ('projection' , self ._projection )
101- order = kw .pop ('order' , self ._order )
102- group_by = kw .pop ('group_by' , self ._group_by )
103-
104- if kw :
105- raise TypeError ("Unknown properties: %s" % ',' .join (kw ))
106-
107- return self .__class__ (
108- kind = kind ,
109- dataset = dataset ,
110- namespace = namespace ,
111- ancestor = ancestor ,
112- filters = filters ,
113- projection = projection ,
114- order = order ,
115- group_by = group_by ,
116- )
117-
11886 @property
11987 def dataset (self ):
12088 """Get the dataset for this Query.
@@ -161,8 +129,6 @@ def kind(self):
161129 """Get the Kind of the Query.
162130
163131 :rtype: string or :class:`Query`
164- :returns: If `kind` is None, returns the kind. If a kind is provided,
165- returns a clone of the :class:`Query` with that kind set.
166132 """
167133 return self ._kind
168134
@@ -221,26 +187,17 @@ def filters(self):
221187 def add_filter (self , property_name , operator , value ):
222188 """Filter the query based on a property name, operator and a value.
223189
224- This will return a clone of the current :class:`Query`
225- filtered by the expression and value provided.
226-
227190 Expressions take the form of::
228191
229- .filter ('<property>', '<operator>', <value>)
192+ .add_filter ('<property>', '<operator>', <value>)
230193
231194 where property is a property stored on the entity in the datastore
232195 and operator is one of ``OPERATORS``
233196 (ie, ``=``, ``<``, ``<=``, ``>``, ``>=``)::
234197
235198 >>> query = Query('Person')
236- >>> filtered_query = query.filter('name', '=', 'James')
237- >>> filtered_query = query.filter('age', '>', 50)
238-
239- Because each call to ``.filter()`` returns a cloned ``Query`` object
240- we are able to string these together::
241-
242- >>> query = Query('Person').filter(
243- ... 'name', '=', 'James').filter('age', '>', 50)
199+ >>> query.add_filter('name', '=', 'James')
200+ >>> query.add_filter('age', '>', 50)
244201
245202 :type property_name: string
246203 :param property_name: A property name.
0 commit comments