Skip to content

Commit ebb6884

Browse files
committed
Beginning to rework Nominee and Nomination
- Legacy-Id: 10607
1 parent de0b7c9 commit ebb6884

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.db import models, migrations
5+
6+
def populate_person(apps, schema_editor):
7+
Nominee = apps.get_model('nomcom','Nominee')
8+
for n in Nominee.objects.all():
9+
n.person = n.email.person
10+
n.save()
11+
12+
class Migration(migrations.Migration):
13+
14+
dependencies = [
15+
('person', '0004_auto_20150308_0440'),
16+
('nomcom', '0009_remove_requirements_dbtemplate_type_from_path'),
17+
]
18+
19+
operations = [
20+
migrations.AddField(
21+
model_name='nominee',
22+
name='person',
23+
field=models.ForeignKey(blank=True, to='person.Person', null=True),
24+
preserve_default=True,
25+
),
26+
migrations.RunPython(populate_person,None)
27+
]

ietf/nomcom/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def __unicode__(self):
111111
class Nominee(models.Model):
112112

113113
email = models.ForeignKey(Email)
114+
person = models.ForeignKey(Person, blank=True, null=True)
114115
nominee_position = models.ManyToManyField('Position', through='NomineePosition')
115116
duplicated = models.ForeignKey('Nominee', blank=True, null=True)
116117
nomcom = models.ForeignKey('NomCom')

0 commit comments

Comments
 (0)