Skip to content

Commit

Permalink
Shorten email field; add colour
Browse files Browse the repository at this point in the history
  • Loading branch information
wsot committed Sep 8, 2022
1 parent 429ca3e commit 81c5f88
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 19 deletions.
18 changes: 0 additions & 18 deletions src/community_db/migrations/0002_person_email_address.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.1 on 2022-09-08 05:03

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("community_db", "0001_initial"),
]

operations = [
migrations.AddField(
model_name="person",
name="email_address",
field=models.EmailField(blank=True, max_length=800),
),
migrations.AddField(
model_name="person",
name="favourite_colour",
field=models.CharField(
choices=[("red", "red"), ("blue", "blue")], default="red", max_length=50
),
),
]
7 changes: 6 additions & 1 deletion src/community_db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@


class Person(models.Model):
class Colours(models.TextChoices):
RED = ('red', 'red')
BLUE = ('blue', 'blue')

first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100, blank=True)
country = models.CharField(max_length=100, blank=True)
mobile_number = models.CharField(max_length=20, blank=True)
email_address = models.EmailField(max_length=900, blank=True)
email_address = models.EmailField(max_length=800, blank=True)
favourite_colour = models.CharField(max_length=50, choices=Colours.choices, default=Colours.RED.value)

0 comments on commit 81c5f88

Please sign in to comment.