Skip to content

Commit

Permalink
relax membership to allow unresolved people
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesturk committed Feb 21, 2017
1 parent 79d5642 commit 6a3d07d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
25 changes: 25 additions & 0 deletions opencivicdata/migrations/0006_auto_20170220_2057.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-02-20 20:57
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('opencivicdata', '0005_add_agenda_item_classification'),
]

operations = [
migrations.AddField(
model_name='membership',
name='person_name',
field=models.CharField(blank=True, default='', max_length=300),
),
migrations.AlterField(
model_name='membership',
name='person',
field=models.ForeignKey(null=True, on_delete=models.deletion.CASCADE, related_name='memberships', to='opencivicdata.Person'),
),
]
3 changes: 2 additions & 1 deletion opencivicdata/models/people_orgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ class PersonSource(LinkBase):
class Membership(OCDBase):
id = OCDIDField(ocd_type='membership')
organization = models.ForeignKey(Organization, related_name='memberships')
person = models.ForeignKey(Person, related_name='memberships')
person = models.ForeignKey(Person, related_name='memberships', null=True)
person_name = models.CharField(max_length=300, blank=True, default='')
post = models.ForeignKey(Post, related_name='memberships', null=True)
on_behalf_of = models.ForeignKey(Organization, related_name='memberships_on_behalf_of',
null=True)
Expand Down

0 comments on commit 6a3d07d

Please sign in to comment.