From e796a13584b9a47b26ec8cc78dab7c316a1acca3 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 28 Nov 2021 10:21:03 +0530 Subject: [PATCH] #9942: Make datatype changes Person model --- app/models.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/app/models.py b/app/models.py index 95f0084..7043288 100644 --- a/app/models.py +++ b/app/models.py @@ -525,6 +525,13 @@ class Search(models.Model): class Person(models.Model): + MR_MRS_CHOICES = ( + ('', ''), + ('Ms', 'Ms'), + ('Ms.', 'Ms.'), + ('Mr', 'Mr'), + ('Mr.', 'Mr.'), + ) id = models.AutoField(primary_key=True) source_id = models.IntegerField(blank=True, null=True) title = models.TextField(blank=True, null=True) @@ -532,19 +539,19 @@ class Person(models.Model): last_name = models.TextField(blank=True, null=True) organisation = models.TextField(blank=True, null=True) position = models.TextField(blank=True, null=True) - contact_email = models.TextField(blank=True, null=True) # email_1 - personal_url = models.TextField(blank=True, null=True) # url ? + contact_email = models.EmailField(blank=True, null=True) # email_1 + personal_url = models.URLField(blank=True, null=True) # url ? biography = models.TextField(blank=True, null=True) field_indexer = models.TextField(db_column='_indexer', blank=True, null=True) # Field renamed because it started with '_'. - mr_mrs = models.TextField(blank=True, null=True) + mr_mrs = models.TextField(blank=True, null=True, choices=MR_MRS_CHOICES) full_name = models.TextField(blank=True, null=True) search_name = models.TextField(blank=True, null=True) - email_2 = models.TextField(blank=True, null=True) - skype = models.TextField(blank=True, null=True) - professional_phone = models.TextField(blank=True, null=True) - mobile_number = models.TextField(blank=True, null=True) - url = models.TextField(blank=True, null=True) + email_2 = models.EmailField(blank=True, null=True) + skype = models.CharField(blank=True, null=True, max_length=50) + professional_phone = models.CharField(blank=True, null=True, max_length=50) + mobile_number = models.CharField(blank=True, null=True, max_length=50) + url = models.URLField(blank=True, null=True) field_of_expertise = models.TextField(blank=True, null=True) status = models.ForeignKey(PeopleStatus, models.DO_NOTHING, blank=True, null=True, to_field='id') entry_date = models.TextField(blank=True, null=True)