Beginning to rework Nominee and Nomination

- Legacy-Id: 10607
This commit is contained in:
Robert Sparks 2015-12-17 21:53:39 +00:00
parent de0b7c9a37
commit ebb6884b70
2 changed files with 28 additions and 0 deletions
ietf/nomcom

View file

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def populate_person(apps, schema_editor):
Nominee = apps.get_model('nomcom','Nominee')
for n in Nominee.objects.all():
n.person = n.email.person
n.save()
class Migration(migrations.Migration):
dependencies = [
('person', '0004_auto_20150308_0440'),
('nomcom', '0009_remove_requirements_dbtemplate_type_from_path'),
]
operations = [
migrations.AddField(
model_name='nominee',
name='person',
field=models.ForeignKey(blank=True, to='person.Person', null=True),
preserve_default=True,
),
migrations.RunPython(populate_person,None)
]

View file

@ -111,6 +111,7 @@ class Nomination(models.Model):
class Nominee(models.Model):
email = models.ForeignKey(Email)
person = models.ForeignKey(Person, blank=True, null=True)
nominee_position = models.ManyToManyField('Position', through='NomineePosition')
duplicated = models.ForeignKey('Nominee', blank=True, null=True)
nomcom = models.ForeignKey('NomCom')