Untitled

mail@pastecode.io avatar
unknown
python
a year ago
937 B
0
Indexable
Never
from rh.gfp.models import *
from contrib.middleware import set_current_user
from standard import models

set_current_user(User.objects.get(username='athenas'))

base_ferias_servidores = 	
base_ferias_membros = ['00100','01200','05100']

base_13_servidores = ['00200','04000','00500','00600','00700','01800','05100','20100','20200','20300','20400','02100']
base_13_membros = ['00100','01200','05100']

dicts = []
dicts.append({'valor':'base_ferias_servidores','rubricas':base_ferias_servidores})
dicts.append({'valor':'base_ferias_membros','rubricas':base_ferias_membros})
dicts.append({'valor':'base_13_servidores','rubricas':base_13_servidores})
dicts.append({'valor':'base_13_membros','rubricas':base_13_membros})

#PECORRENDO dicts
for di in dicts:


	choice = Choice.objects.get(label=di['valor'],app_label='gfp')
	print choice
	for rubrica in di['rubricas']:
		evento = Evento.objects.get(numero=rubrica)
		evento.tags.add(choice)