<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def until(self, end, field=None):
 """ Add the end date to query data upto that date sets the default end date for each query :param end: date to stop looking at the fields (to date) :param field: specific field for the end date in range filter for the Search object :returns: self, which allows the method to be chainable with the other methods """


        if not field:
            field = "grimoire_creation_date"
        self.end_date = end

        date_dict = {field: {"lte": "{}".format(self.end_date.isoformat())}}
        self.search = self.search.filter("range", **date_dict)
        return self