From c776a9abfb2e009cf734a39787c0974574d3dac5 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 19 Nov 2021 09:27:57 +0530 Subject: [PATCH] Change remaining boolean fields --- app/migrations/0011_auto_20211119_0354.py | 28 +++++++++++++++++++++++ app/models.py | 9 +++++--- 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 app/migrations/0011_auto_20211119_0354.py diff --git a/app/migrations/0011_auto_20211119_0354.py b/app/migrations/0011_auto_20211119_0354.py new file mode 100644 index 0000000..4d5af07 --- /dev/null +++ b/app/migrations/0011_auto_20211119_0354.py @@ -0,0 +1,28 @@ +# Generated by Django 3.2.5 on 2021-11-19 03:54 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('app', '0010_auto_20211119_0201'), + ] + + operations = [ + migrations.AlterField( + model_name='person', + name='news_letter', + field=models.BooleanField(default=False), + ), + migrations.AlterField( + model_name='person', + name='profile_on_web', + field=models.BooleanField(default=False), + ), + migrations.AlterField( + model_name='person', + name='updated', + field=models.BooleanField(default=False), + ), + ] diff --git a/app/models.py b/app/models.py index 94c903f..512d702 100644 --- a/app/models.py +++ b/app/models.py @@ -499,7 +499,7 @@ class Person(models.Model): status = models.TextField(blank=True, null=True) entry_date = models.TextField(blank=True, null=True) gmba_function = models.TextField(blank=True, null=True) - news_letter = models.TextField(blank=True, null=True) + news_letter = models.BooleanField(default=False) country_lookup = models.TextField(blank=True, null=True) organization = models.ForeignKey(Organization, models.DO_NOTHING, blank=True, null=True) birds = models.BooleanField(default=False) @@ -537,8 +537,8 @@ class Person(models.Model): national = models.BooleanField(default=False) _global = models.BooleanField(default=False) geographic_area_of_expertise = models.TextField(blank=True, null=True) - profile_on_web = models.TextField(blank=True, null=True) - updated = models.TextField(blank=True, null=True) + profile_on_web = models.BooleanField(default=False) + updated = models.BooleanField(default=False) orcid = models.TextField(blank=True, null=True) web_of_science = models.TextField(blank=True, null=True) twitter = models.TextField(blank=True, null=True) @@ -547,6 +547,9 @@ class Person(models.Model): class Meta: db_table = 'person' + def get_regional(self): + return False + def index(self): self.field_indexer = " ".join([ self.first_name, self.last_name, self.organisation, self.position, self.biography