Ticket #196: date_based_integer_months.patch
File date_based_integer_months.patch, 1.5 KB (added by , 19 years ago) |
---|
-
date_based.py
92 92 """ 93 93 try: 94 94 date = datetime.date(*time.strptime(year+month, '%Y%b')[:3]) 95 except ValueError: 96 raise Http404 95 except ValueError: 96 try: 97 date = datetime.date(int(year), int(month)) 98 except ValueError: 99 raise Http404 97 100 mod = get_module(app_label, module_name) 98 101 now = datetime.datetime.now() 99 102 # Calculate first and last day of month, for use in a date-range lookup. … … 144 147 """ 145 148 try: 146 149 date = datetime.date(*time.strptime(year+month+day, '%Y%b%d')[:3]) 147 except ValueError: 148 raise Http404 150 except ValueError: 151 try: 152 date = datetime.date(int(year), int(month), int(day)) 153 except ValueError: 154 raise Http404 149 155 mod = get_module(app_label, module_name) 150 156 now = datetime.datetime.now() 151 157 lookup_kwargs = { … … 196 202 """ 197 203 try: 198 204 date = datetime.datetime(*time.strptime(year+month+day, '%Y%b%d')[:3]) 199 except ValueError: 200 raise Http404 205 except ValueError: 206 try: 207 date = datetime.date(int(year), int(month), int(day)) 208 except ValueError: 209 raise Http404 201 210 mod = get_module(app_label, module_name) 202 211 now = datetime.datetime.now() 203 212 lookup_kwargs = {