Skip to content

Commit

Permalink
add start and end date to person model
Browse files Browse the repository at this point in the history
This is to enable use to indicate when an MP's term has expired.
  • Loading branch information
struan committed Dec 14, 2023
1 parent e8d6dd6 commit 735bdd0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions hub/migrations/0059_person_end_date_person_start_date.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.5 on 2023-12-14 15:25

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("hub", "0058_areaoverlap_area_overlaps"),
]

operations = [
migrations.AddField(
model_name="person",
name="end_date",
field=models.DateField(null=True),
),
migrations.AddField(
model_name="person",
name="start_date",
field=models.DateField(null=True),
),
]
2 changes: 2 additions & 0 deletions hub/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ class Person(models.Model):
name = models.CharField(max_length=200)
area = models.ForeignKey(Area, on_delete=models.CASCADE)
photo = models.ImageField(null=True, upload_to="person")
start_date = models.DateField(null=True)
end_date = models.DateField(null=True)

def __str__(self):
return self.name
Expand Down

0 comments on commit 735bdd0

Please sign in to comment.