Updated model fields that had unnecessarily large textAreas for inputs. They are now charFields, which are better sized

This commit is contained in:
CocoByte 2024-02-23 15:44:54 -07:00
parent 92bd8f51b9
commit cc2e24d451
No known key found for this signature in database
GPG key ID: BBFAA2526384C97F
5 changed files with 47 additions and 46 deletions

View file

@ -15,23 +15,23 @@ class Contact(TimeStampedModel):
on_delete=models.SET_NULL, on_delete=models.SET_NULL,
) )
first_name = models.TextField( first_name = models.CharField(
null=True, null=True,
blank=True, blank=True,
verbose_name="first name / given name", verbose_name="first name / given name",
db_index=True, db_index=True,
) )
middle_name = models.TextField( middle_name = models.CharField(
null=True, null=True,
blank=True, blank=True,
) )
last_name = models.TextField( last_name = models.CharField(
null=True, null=True,
blank=True, blank=True,
verbose_name="last name / family name", verbose_name="last name / family name",
db_index=True, db_index=True,
) )
title = models.TextField( title = models.CharField(
null=True, null=True,
blank=True, blank=True,
verbose_name="title or role in your organization", verbose_name="title or role in your organization",

View file

@ -391,13 +391,13 @@ class DomainApplication(TimeStampedModel):
help_text="Is the tribe recognized by a state", help_text="Is the tribe recognized by a state",
) )
tribe_name = models.TextField( tribe_name = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Name of tribe", help_text="Name of tribe",
) )
federal_agency = models.TextField( federal_agency = models.CharField(
choices=AGENCY_CHOICES, choices=AGENCY_CHOICES,
null=True, null=True,
blank=True, blank=True,
@ -418,25 +418,25 @@ class DomainApplication(TimeStampedModel):
help_text="Is your organization an election office?", help_text="Is your organization an election office?",
) )
organization_name = models.TextField( organization_name = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Organization name", help_text="Organization name",
db_index=True, db_index=True,
) )
address_line1 = models.TextField( address_line1 = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Street address", help_text="Street address",
verbose_name="Address line 1", verbose_name="Address line 1",
) )
address_line2 = models.TextField( address_line2 = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Street address line 2 (optional)", help_text="Street address line 2 (optional)",
verbose_name="Address line 2", verbose_name="Address line 2",
) )
city = models.TextField( city = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="City", help_text="City",
@ -455,13 +455,13 @@ class DomainApplication(TimeStampedModel):
help_text="Zip code", help_text="Zip code",
db_index=True, db_index=True,
) )
urbanization = models.TextField( urbanization = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Urbanization (required for Puerto Rico only)", help_text="Urbanization (required for Puerto Rico only)",
) )
about_your_organization = models.TextField( about_your_organization = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Information about your organization", help_text="Information about your organization",

View file

@ -67,13 +67,13 @@ class DomainInformation(TimeStampedModel):
help_text="Is the tribe recognized by a state", help_text="Is the tribe recognized by a state",
) )
tribe_name = models.TextField( tribe_name = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Name of tribe", help_text="Name of tribe",
) )
federal_agency = models.TextField( federal_agency = models.CharField(
choices=AGENCY_CHOICES, choices=AGENCY_CHOICES,
null=True, null=True,
blank=True, blank=True,
@ -94,25 +94,25 @@ class DomainInformation(TimeStampedModel):
help_text="Is your organization an election office?", help_text="Is your organization an election office?",
) )
organization_name = models.TextField( organization_name = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Organization name", help_text="Organization name",
db_index=True, db_index=True,
) )
address_line1 = models.TextField( address_line1 = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Street address", help_text="Street address",
verbose_name="Street address", verbose_name="Street address",
) )
address_line2 = models.TextField( address_line2 = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Street address line 2 (optional)", help_text="Street address line 2 (optional)",
verbose_name="Street address line 2 (optional)", verbose_name="Street address line 2 (optional)",
) )
city = models.TextField( city = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="City", help_text="City",
@ -132,7 +132,7 @@ class DomainInformation(TimeStampedModel):
help_text="Zip code", help_text="Zip code",
db_index=True, db_index=True,
) )
urbanization = models.TextField( urbanization = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Urbanization (required for Puerto Rico only)", help_text="Urbanization (required for Puerto Rico only)",

View file

@ -59,22 +59,22 @@ class PublicContact(TimeStampedModel):
related_name="contacts", related_name="contacts",
) )
name = models.TextField(null=False, help_text="Contact's full name") name = models.CharField(null=False, help_text="Contact's full name")
org = models.TextField(null=True, help_text="Contact's organization (null ok)") org = models.CharField(null=True, help_text="Contact's organization (null ok)")
street1 = models.TextField(null=False, help_text="Contact's street") street1 = models.CharField(null=False, help_text="Contact's street")
street2 = models.TextField(null=True, help_text="Contact's street (null ok)") street2 = models.CharField(null=True, help_text="Contact's street (null ok)")
street3 = models.TextField(null=True, help_text="Contact's street (null ok)") street3 = models.CharField(null=True, help_text="Contact's street (null ok)")
city = models.TextField(null=False, help_text="Contact's city") city = models.CharField(null=False, help_text="Contact's city")
sp = models.TextField(null=False, help_text="Contact's state or province") sp = models.CharField(null=False, help_text="Contact's state or province")
pc = models.TextField(null=False, help_text="Contact's postal code") pc = models.CharField(null=False, help_text="Contact's postal code")
cc = models.TextField(null=False, help_text="Contact's country code") cc = models.CharField(null=False, help_text="Contact's country code")
email = models.TextField(null=False, help_text="Contact's email address") email = models.EmailField(null=False, help_text="Contact's email address")
voice = models.TextField(null=False, help_text="Contact's phone number. Must be in ITU.E164.2005 format") voice = models.PhoneNumberField(null=False, help_text="Contact's phone number. Must be in ITU.E164.2005 format")
fax = models.TextField( fax = models.PhoneNumberField(
null=True, null=True,
help_text="Contact's fax number (null ok). Must be in ITU.E164.2005 format.", help_text="Contact's fax number (null ok). Must be in ITU.E164.2005 format.",
) )
pw = models.TextField(null=False, help_text="Contact's authorization code. 16 characters minimum.") pw = models.CharField(null=False, help_text="Contact's authorization code. 16 characters minimum.")
@classmethod @classmethod
def get_default_registrant(cls): def get_default_registrant(cls):

View file

@ -1,5 +1,6 @@
from django.db import models from django.db import models
from .utility.time_stamped_model import TimeStampedModel from .utility.time_stamped_model import TimeStampedModel
from phonenumber_field.modelfields import PhoneNumberField # type: ignore
class StatusChoices(models.TextChoices): class StatusChoices(models.TextChoices):
@ -17,13 +18,13 @@ class TransitionDomain(TimeStampedModel):
# classes that import TransitionDomain # classes that import TransitionDomain
StatusChoices = StatusChoices StatusChoices = StatusChoices
username = models.TextField( username = models.CharField(
null=False, null=False,
blank=False, blank=False,
verbose_name="Username", verbose_name="Username",
help_text="Username - this will be an email address", help_text="Username - this will be an email address",
) )
domain_name = models.TextField( domain_name = models.CharField(
null=True, null=True,
blank=True, blank=True,
verbose_name="Domain name", verbose_name="Domain name",
@ -49,25 +50,25 @@ class TransitionDomain(TimeStampedModel):
verbose_name="Processed", verbose_name="Processed",
help_text="Indicates whether this TransitionDomain was already processed", help_text="Indicates whether this TransitionDomain was already processed",
) )
organization_type = models.TextField( organization_type = models.CharField(
max_length=255, max_length=255,
null=True, null=True,
blank=True, blank=True,
help_text="Type of organization", help_text="Type of organization",
) )
organization_name = models.TextField( organization_name = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Organization name", help_text="Organization name",
db_index=True, db_index=True,
) )
federal_type = models.TextField( federal_type = models.CharField(
max_length=50, max_length=50,
null=True, null=True,
blank=True, blank=True,
help_text="Federal government branch", help_text="Federal government branch",
) )
federal_agency = models.TextField( federal_agency = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Federal agency", help_text="Federal agency",
@ -80,44 +81,44 @@ class TransitionDomain(TimeStampedModel):
null=True, null=True,
help_text=("Duplication of registry's expiration " "date saved for ease of reporting"), help_text=("Duplication of registry's expiration " "date saved for ease of reporting"),
) )
first_name = models.TextField( first_name = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="First name", help_text="First name",
verbose_name="first name / given name", verbose_name="first name / given name",
db_index=True, db_index=True,
) )
middle_name = models.TextField( middle_name = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Middle name (optional)", help_text="Middle name (optional)",
) )
last_name = models.TextField( last_name = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Last name", help_text="Last name",
) )
title = models.TextField( title = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Title", help_text="Title",
) )
email = models.TextField( email = models.EmailField(
null=True, null=True,
blank=True, blank=True,
help_text="Email", help_text="Email",
) )
phone = models.TextField( phone = models.PhoneNumberField(
null=True, null=True,
blank=True, blank=True,
help_text="Phone", help_text="Phone",
) )
address_line = models.TextField( address_line = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="Street address", help_text="Street address",
) )
city = models.TextField( city = models.CharField(
null=True, null=True,
blank=True, blank=True,
help_text="City", help_text="City",