def ancestor(self, ancestor):
		"""
			Sets an ancestor for this query.

			This restricts the query to only return result entities that are descended
			from a given entity. In other words, all of the results will have the
			ancestor as their parent, or parent's parent, and so on.

			Raises BadArgumentError or BadKeyError if parent is not an existing Entity
			or Key in the data store.

			:param ancestor: Entity or Key. The key must be complete.
			:type ancestor: server.db.Entity | Key

			:returns: Returns the query itself for chaining.
			:rtype: server.db.Query
		"""
		self.datastoreQuery.Ancestor( ancestor )
		return( self )