swjtuacmer / Ranker

Show the rank list of swjtuacmer.
MIT License
1 stars 2 forks source link

To make the Update() function complete. #22

Closed Desgard closed 7 years ago

Desgard commented 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.


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