Closed Desgard closed 7 years ago
In the app RanklList, the file views.py owned a function UpdateDB(request). The next, we need make it support bestcoder, hdu, poj.
RanklList
views.py
UpdateDB(request)
def UpdateDB(request): users = User.objects.all() # print users for item in users: item_codeforces_rating = crawler.UpdateCodeforces(item.codeforces_id) item.codeforces_rating = item_codeforces_rating # 这里写数据库更新代码 item.save() return HttpResponse('success') ```python
In the app
RanklList
, the fileviews.py
owned a functionUpdateDB(request)
. The next, we need make it support bestcoder, hdu, poj.