Esempio n. 1
0
    def handle(self, *args, **options):
        u = Uva()
        for p in u.getProblems():
            try:
                problem = Problem.objects.get(code=p['id'], judge='uva')
            except Problem.DoesNotExist:
                problem = Problem()

            problem.code = p['id']
            problem.number = p['number']
            problem.name = p['name']
            problem.category = p['category']
            problem.solved = p['solved']
            problem.level = 0
            problem.judge = 'uva'
            problem.save()
Esempio n. 2
0
    def handle(self, *args, **options):
        s = Spoj()
        problems = s.getProblems()

        for p in problems:
            try:
                problem = Problem.objects.get(code=p['code'], judge='spoj')
            except Problem.DoesNotExist:
                problem = Problem()

            problem.name = p['name']
            problem.code = p['code']
            problem.number = p['number']
            problem.solved = p['solved']

            problem.category = 'U'
            problem.level = 0
            problem.judge = 'spoj'
            problem.save()

        print('%d problems.' % len(problems))
Esempio n. 3
0
	def handle(self, *args, **options):
		s = Spoj()
		problems = s.getProblems()

		for p in problems:
			try:
				problem = Problem.objects.get(code=p['code'], judge='spoj')
			except Problem.DoesNotExist:
				problem = Problem()

			problem.name = p['name']
			problem.code = p['code']
			problem.number = p['number']
			problem.solved = p['solved']

			problem.category = 'U'
			problem.level = 0
			problem.judge = 'spoj'
			problem.save()

		print('%d problems.' % len(problems))
Esempio n. 4
0
    def handle(self, *args, **options):
        u = Uri()
        while not u.done:
            problems = u.getProblems()

            if not problems:
                break

            for p in problems:
                try:
                    problem = Problem.objects.get(code=p['code'], judge='uri')
                except Problem.DoesNotExist:
                    problem = Problem()

                problem.code = p['code']
                problem.name = p['name']
                problem.category = p['category'][0]
                problem.solved = p['solved']
                problem.level = p['level']
                problem.judge = 'uri'
                problem.save()
Esempio n. 5
0
    def handle(self, *args, **options):
        u = Uri()
        while not u.done:
            problems = u.getProblems()

            if not problems:
                break

            for p in problems:
                try:
                    problem = Problem.objects.get(code=p["code"], judge="uri")
                except Problem.DoesNotExist:
                    problem = Problem()

                problem.code = p["code"]
                problem.name = p["name"]
                problem.category = p["category"][0]
                problem.solved = p["solved"]
                problem.level = p["level"]
                problem.judge = "uri"
                problem.save()