django/views/generic/dates.py
def _date_from_string(year, year_format, month, month_format, day='', day_format='', delim='__'):
    """
    Helper: get a datetime.date object given a format string and a year,
    month, and possibly day; raise a 404 for an invalid date.
    """
    format = delim.join((year_format, month_format, day_format))
    datestr = delim.join((year, month, day))
    try:
        return datetime.datetime.strptime(datestr, format).date()
    except ValueError:
        raise Http404(_(u"Invalid date string '%(datestr)s' given format '%(format)s'") % {
            'datestr': datestr,
            'format': format,
        })

    Helper: get a datetime.date object given a format string and a year,
    month, and possibly day; raise a 404 for an invalid date.
    
get a datetime.date object given a format string and a year,
month, and possibly day; raise a 404 for an invalid date.
get a datetime . date object given a format string and a year month and possibly day ; raise a 404 for an invalid date .
def _date_from_string(year, year_format, month, month_format, day='', day_format='', delim='__'):
    format = delim.join((year_format, month_format, day_format))
    datestr = delim.join((year, month, day))
    try:
        return datetime.datetime.strptime(datestr, format).date()
    except ValueError:
        raise Http404(_(u"Invalid date string '%(datestr)s' given format '%(format)s'") % {
            'datestr': datestr,
            'format': format,
        })
def _date_from_string ( year , year_format , month , month_format , day = '' , day_format = '' , delim = '__' ) : format = delim . join ( ( year_format , month_format , day_format ) ) datestr = delim . join ( ( year , month , day ) ) try : return datetime . datetime . strptime ( datestr , format ) . date ( ) except ValueError : raise Http404 ( _ ( u"Invalid date string '%(datestr)s' given format '%(format)s'" ) % { 'datestr' : datestr , 'format' : format , } )
Helper: get a datetime.date object given a format string and a year,
month, and possibly day; raise a 404 for an invalid date.
Helper : get a datetime . date object given a format string and a year month and possibly day ; raise a 404 for an invalid date .
"""
    Helper: get a datetime.date object given a format string and a year,
    month, and possibly day; raise a 404 for an invalid date.
    """
year
year_format
month
month_format
day
day_format
delim