Adds filtering by ranges of dates in the admin filter sidebar.

class DateFilterSpec(DateFieldFilterSpec):

    def __init__(self, f, request, params, model, model_admin):
        super(DateFilterSpec, self).__init__(f, request, params, model,
        self.field_generic = '%s__' %

    def title(self):
        title = super(DateFilterSpec, self).title()
        form = DateForm(initial=self.params)
        out =  u"""
                .calendarbox {
                    /*left:0 !important;*/
            <form method="GET" action="">
            <link rel="stylesheet" type="text/css" href="%(admin_media)scss/forms.css" />
            <link rel="stylesheet" type="text/css" href="%(admin_media)scss/widgets.css" />
            <li> <input type="submit" value="%(search)s"> </li>
        """ % {'search':_('Go'),'form_media','form':form.as_ul(),'admin_media':settings.ADMIN_MEDIA_PREFIX}
        return mark_safe(title) + mark_safe(out)

coded by nessus