diff --git a/www/conservancy/apps/staff/migrations/0001_initial.py b/www/conservancy/apps/staff/migrations/0001_initial.py new file mode 100644 index 00000000..ecb61e4c --- /dev/null +++ b/www/conservancy/apps/staff/migrations/0001_initial.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2021-11-28 21:12 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Person', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('username', models.CharField(max_length=20)), + ('formal_name', models.CharField(max_length=200)), + ('casual_name', models.CharField(max_length=200)), + ('currently_employed', models.BooleanField(default=True)), + ('date_created', models.DateTimeField(auto_now_add=True)), + ('date_last_modified', models.DateTimeField(auto_now=True)), + ], + options={ + 'verbose_name_plural': 'people', + }, + ), + ] diff --git a/www/conservancy/apps/staff/migrations/0002_auto_20211128_2112.py b/www/conservancy/apps/staff/migrations/0002_auto_20211128_2112.py new file mode 100644 index 00000000..0725e2ec --- /dev/null +++ b/www/conservancy/apps/staff/migrations/0002_auto_20211128_2112.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2021-11-28 21:12 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('staff', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='person', + name='username', + field=models.CharField(max_length=20, unique=True), + ), + ] diff --git a/www/conservancy/apps/staff/migrations/__init__.py b/www/conservancy/apps/staff/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/www/conservancy/apps/staff/models.py b/www/conservancy/apps/staff/models.py index 70876680..e1595c84 100644 --- a/www/conservancy/apps/staff/models.py +++ b/www/conservancy/apps/staff/models.py @@ -7,7 +7,7 @@ class Person(models.Model): Referenced from other models (blog, events, etc) """ - username = models.CharField(max_length=20) + username = models.CharField(max_length=20, unique=True) formal_name = models.CharField(max_length=200) casual_name = models.CharField(max_length=200) # title = models.CharField(max_length=200, blank=True) @@ -28,4 +28,3 @@ class Person(models.Model): def biography_url(self): return u"/about/#%s" % self.username -