django ?????Χ????????
???????????? ???????[ 2013/12/2 10:34:04 ] ????????
?????????л?????Χ????django???????request??????????format???????Χ???ú???????????
??????????????????????web??????????????????Χ?????????????в???????Χ????????
????????????model????????????
class book(models.Model):
name = models.CharField(max_length=50?? unique=True)
date = models.DateTimeField()
def __unicode__(self): return self.name
???????????????????request.GET????????Χ???????????
request.GET = {'year_from': 2010?? 'month_from': 1?? 'day_from': 1??
'year_to':2013?? 'month_to': 10?? 'day_to': 1}
????????model?????date??????models.DateTimefield()????????????request?????????????datetime????(????django???????????????)??
import datetime
def filter(request):
if 'year_from' and 'month_from' and 'day_from' and
'year_to' and 'month_to' and 'day_to' in request.GET:
y = request.GET['year_from']
m = request.GET['month_from']
d = request.GET['day_from']
date_from = datetime.datetime(int(y)?? int(m)?? int(d)?? 0?? 0)
y = request.GET['year_to']
m = request.GET['month_to']
d = request.GET['day_to']
date_to = datetime.datetime(int(y)?? int(m)?? int(d)?? 0?? 0)
else:
print "error time range!"
??????

???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11