Django的filter查詢
name__contains表示精確大小寫的模糊查詢
使用name__icontains表示忽略大小寫
year_count = DownloadFile.objects.filter(date__contains='2018').count()
year_up_rate=round((year_count-DownloadFile.objects.filter(date__contains='2017').count())/1000)
Django的filter查詢
name__contains表示精確大小寫的模糊查詢
使用name__icontains表示忽略大小寫
year_count = DownloadFile.objects.filter(date__contains='2018').count()
year_up_rate=round((year_count-DownloadFile.objects.filter(date__contains='2017').count())/1000)
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。