'Get a date list by calling `queryset.dates()`, checking along the way
for empty lists that aren\'t allowed.'

def get_date_list(self, queryset, date_type):

    date_field = self.get_date_field()
    allow_empty = self.get_allow_empty()
    date_list = queryset.dates(date_field, date_type)[::(-1)]
    if ((date_list is not None) and (not date_list) and (not allow_empty)):
        raise Http404((_(u'No    %(verbose_name_plural)s    available') % {'verbose_name_plural': force_unicode(qs.model._meta.verbose_name_plural)}))
    return date_list
