-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmakegroups_2026.py
More file actions
47 lines (42 loc) · 1.1 KB
/
makegroups_2026.py
File metadata and controls
47 lines (42 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# encoding: utf8
import os
import sys
import codecs
sys.stdin = codecs.getreader('utf8')(sys.stdin)
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mftutor.settings")
application = get_wsgi_application()
from mftutor.tutor.models import TutorGroup
input_string = """gruppeansvarlige,Gruppeansvarlige
buret,Buret
cs,CS-Oplæg
eval,Evaluering
hytte,Hytte
hoestfest,Høstfest
indkoeb,Indkøb og bus
korrektur,Korrektur
labfys,IFA-Labrundvisning
labnano,iNANO-labrundvisning
latex,LaTeX-Git Support
web,Web
legedag,Legegruppen
parxafari,ParXafari
grise,Praktiske Grise
rkfw,RKFW og Rus2tursguide
rusrevy,Rusrevy
tutorsmiley,Tutorsmiley
sol,SOL
sportsdag,Sportsdagsgruppen
tutorfest,Tutorfest
sangbog,Sangbog
tutorbog,Tutorbog
"""
year = 2026
qs = TutorGroup.objects.filter(year=year)
existing_handles = set(g.handle for g in qs)
for line in input_string.splitlines():
handle, name = line.split(',')
if handle not in existing_handles:
tg = TutorGroup(handle=handle, name=name, year=year)
tg.save()