1
0
Fork 0
mirror of https://github.com/Findus23/se-simulator.git synced 2024-09-19 15:53:45 +02:00
se-simulator/shuffle.py
Lukas Winkler de90a78874 make python files executable
thanks to jaytaylor (#2)
2018-05-13 13:32:13 +02:00

16 lines
342 B
Python
Executable file

#!/usr/bin/env python
import utils
from models import *
from extra_data import site_colors
query = Question.select().order_by(SQL("RAND()"))
count = query.count()
utils.save_question_count(count)
i = 0
for question in query:
question.random = i
i += 1
if i % 50 == 0:
print("{}/{}".format(i, count))
question.save()