diff --git a/app/migrations/0024_alter_resource_stars.py b/app/migrations/0024_alter_resource_stars.py new file mode 100644 index 0000000..e6ed1fe --- /dev/null +++ b/app/migrations/0024_alter_resource_stars.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.5 on 2021-11-26 08:12 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('app', '0023_alter_range_feature'), + ] + + operations = [ + migrations.AlterField( + model_name='resource', + name='stars', + field=models.TextField(blank=True, choices=[('', ''), ('-', '-'), ('*', '*'), ('**', '**'), ('***', '***'), ('****', '****'), ('*****', '*****')], null=True), + ), + ] diff --git a/app/models.py b/app/models.py index 600289f..533463a 100644 --- a/app/models.py +++ b/app/models.py @@ -147,6 +147,15 @@ class Range(models.Model): class Resource(models.Model): + STAR_CHOICES = ( + ("", ""), + ("-", "-"), + ("*", "*"), + ("**", "**"), + ("***", "***"), + ("****", "****"), + ("*****", "*****"), + ) id = models.AutoField(primary_key=True) source_id = models.IntegerField(blank=True, null=True) title = models.TextField(blank=True, null=True) @@ -158,7 +167,7 @@ class Resource(models.Model): author_keywords = models.TextField(blank=True, null=True) lat = models.TextField(blank=True, null=True) lon = models.TextField(blank=True, null=True) - stars = models.TextField(blank=True, null=True) + stars = models.TextField(blank=True, null=True, choices=STAR_CHOICES) PEGASuS_Check_map_with_author = models.TextField(blank=True, null=True) PEGASuS_polygon_ID = models.TextField(blank=True, null=True) PEGASuS_Polygon_comments = models.TextField(blank=True, null=True)