'Sets up any special features of the query attribute.
Called by the _clone() method after initializing the rest of the
instance.'

def _setup_query(self):

    self.query.clear_deferred_loading()
    self.query = self.query.clone(klass=sql.DateQuery, setup=True)
    self.query.select = []
    field = self.model._meta.get_field(self._field_name, many_to_many=False)
    assert isinstance(field, DateField), ("%r    isn't    a    DateField." % field.name)
    self.query.add_date_select(field, self._kind, self._order)
    if field.null:
        self.query.add_filter((('%s__isnull' % field.name), False))
