Beginning to rework Nominee and Nomination
- Legacy-Id: 10607
This commit is contained in:
parent
de0b7c9a37
commit
ebb6884b70
ietf/nomcom
27
ietf/nomcom/migrations/0010_nominee_person.py
Normal file
27
ietf/nomcom/migrations/0010_nominee_person.py
Normal 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)
|
||||
]
|
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue