From 01b20cd844cd895416784315be2c0ae6e1e5aa80 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sun, 27 Feb 2022 18:45:06 -0500 Subject: [PATCH] membershipworks: Define nullable fields as blank --- membershipworks/models.py | 142 +++++++++++++++++++++++--------------- 1 file changed, 86 insertions(+), 56 deletions(-) diff --git a/membershipworks/models.py b/membershipworks/models.py index 95ecd18..6a5af2a 100644 --- a/membershipworks/models.py +++ b/membershipworks/models.py @@ -8,7 +8,7 @@ from django.db.models import Exists, OuterRef class Flag(models.Model): id = models.CharField(max_length=24, primary_key=True) - name = models.TextField(null=True) + name = models.TextField(null=True, blank=True) type = models.CharField(max_length=6) def __str__(self): @@ -49,37 +49,53 @@ class Member(models.Model): objects = MemberQuerySet.as_manager() uid = models.CharField(max_length=24, primary_key=True) - year_of_birth = models.TextField(db_column="Year of Birth", null=True) - account_name = models.TextField(db_column="Account Name", null=True) - first_name = models.TextField(db_column="First Name", null=True) - last_name = models.TextField(db_column="Last Name", null=True) - phone = models.TextField(db_column="Phone", null=True) - email = models.TextField(db_column="Email", null=True) - volunteer_email = models.TextField(db_column="Volunteer Email", null=True) - address_street = models.TextField(db_column="Address (Street)", null=True) - address_city = models.TextField(db_column="Address (City)", null=True) - address_state_province = models.TextField( - db_column="Address (State/Province)", null=True + year_of_birth = models.TextField(db_column="Year of Birth", null=True, blank=True) + account_name = models.TextField(db_column="Account Name", null=True, blank=True) + first_name = models.TextField(db_column="First Name", null=True, blank=True) + last_name = models.TextField(db_column="Last Name", null=True, blank=True) + phone = models.TextField(db_column="Phone", null=True, blank=True) + email = models.TextField(db_column="Email", null=True, blank=True) + volunteer_email = models.TextField( + db_column="Volunteer Email", null=True, blank=True + ) + address_street = models.TextField( + db_column="Address (Street)", null=True, blank=True + ) + address_city = models.TextField(db_column="Address (City)", null=True, blank=True) + address_state_province = models.TextField( + db_column="Address (State/Province)", null=True, blank=True + ) + address_postal_code = models.TextField( + db_column="Address (Postal Code)", null=True, blank=True + ) + address_country = models.TextField( + db_column="Address (Country)", null=True, blank=True + ) + profile_description = models.TextField( + db_column="Profile description", null=True, blank=True + ) + website = models.TextField(db_column="Website", null=True, blank=True) + fax = models.TextField(db_column="Fax", null=True, blank=True) + contact_person = models.TextField(db_column="Contact Person", null=True, blank=True) + password = models.TextField(db_column="Password", null=True, blank=True) + position_relation = models.TextField( + db_column="Position/relation", null=True, blank=True + ) + parent_account_id = models.TextField( + db_column="Parent Account ID", null=True, blank=True ) - address_postal_code = models.TextField(db_column="Address (Postal Code)", null=True) - address_country = models.TextField(db_column="Address (Country)", null=True) - profile_description = models.TextField(db_column="Profile description", null=True) - website = models.TextField(db_column="Website", null=True) - fax = models.TextField(db_column="Fax", null=True) - contact_person = models.TextField(db_column="Contact Person", null=True) - password = models.TextField(db_column="Password", null=True) - position_relation = models.TextField(db_column="Position/relation", null=True) - parent_account_id = models.TextField(db_column="Parent Account ID", null=True) gift_membership_purchased_by = models.TextField( - db_column="Gift Membership purchased by", null=True + db_column="Gift Membership purchased by", null=True, blank=True ) purchased_gift_membership_for = models.TextField( - db_column="Purchased Gift Membership for", null=True + db_column="Purchased Gift Membership for", null=True, blank=True ) - closet_storage = models.TextField(db_column="Closet Storage #", null=True) - storage_shelf = models.TextField(db_column="Storage Shelf #", null=True) + closet_storage = models.TextField( + db_column="Closet Storage #", null=True, blank=True + ) + storage_shelf = models.TextField(db_column="Storage Shelf #", null=True, blank=True) personal_studio_space = models.TextField( - db_column="Personal Studio Space #", null=True + db_column="Personal Studio Space #", null=True, blank=True ) access_permitted_shops_during_extended_hours = models.BooleanField( db_column="Access Permitted Shops During Extended Hours?" @@ -98,49 +114,63 @@ class Member(models.Model): access_storage_closet = models.BooleanField(db_column="Access Storage Closet?") access_studio_space = models.BooleanField(db_column="Access Studio Space?") access_front_door = models.BooleanField(db_column="Access Front Door?") - access_card_number = models.TextField(db_column="Access Card Number", null=True) - access_card_facility_code = models.TextField( - db_column="Access Card Facility Code", null=True + access_card_number = models.TextField( + db_column="Access Card Number", null=True, blank=True ) - auto_billing_id = models.TextField(db_column="Auto Billing ID", null=True) - billing_method = models.TextField(db_column="Billing Method", null=True) - renewal_date = models.DateField(db_column="Renewal Date", null=True) - join_date = models.DateField(db_column="Join Date", null=True) - admin_note = models.TextField(db_column="Admin note", null=True) + access_card_facility_code = models.TextField( + db_column="Access Card Facility Code", null=True, blank=True + ) + auto_billing_id = models.TextField( + db_column="Auto Billing ID", null=True, blank=True + ) + billing_method = models.TextField(db_column="Billing Method", null=True, blank=True) + renewal_date = models.DateField(db_column="Renewal Date", null=True, blank=True) + join_date = models.DateField(db_column="Join Date", null=True, blank=True) + admin_note = models.TextField(db_column="Admin note", null=True, blank=True) profile_gallery_image_url = models.TextField( - db_column="Profile gallery image URL", null=True + db_column="Profile gallery image URL", null=True, blank=True ) business_card_image_url = models.TextField( - db_column="Business card image URL", null=True + db_column="Business card image URL", null=True, blank=True ) - instagram = models.TextField(db_column="Instagram", null=True) - pinterest = models.TextField(db_column="Pinterest", null=True) - youtube = models.TextField(db_column="Youtube", null=True) - yelp = models.TextField(db_column="Yelp", null=True) - google = models.TextField(db_column="Google+", null=True) - bbb = models.TextField(db_column="BBB", null=True) - twitter = models.TextField(db_column="Twitter", null=True) - facebook = models.TextField(db_column="Facebook", null=True) - linked_in = models.TextField(db_column="LinkedIn", null=True) + instagram = models.TextField(db_column="Instagram", null=True, blank=True) + pinterest = models.TextField(db_column="Pinterest", null=True, blank=True) + youtube = models.TextField(db_column="Youtube", null=True, blank=True) + yelp = models.TextField(db_column="Yelp", null=True, blank=True) + google = models.TextField(db_column="Google+", null=True, blank=True) + bbb = models.TextField(db_column="BBB", null=True, blank=True) + twitter = models.TextField(db_column="Twitter", null=True, blank=True) + facebook = models.TextField(db_column="Facebook", null=True, blank=True) + linked_in = models.TextField(db_column="LinkedIn", null=True, blank=True) do_not_show_street_address_in_profile = models.TextField( - db_column="Do not show street address in profile", null=True + db_column="Do not show street address in profile", null=True, blank=True ) do_not_list_in_directory = models.TextField( - db_column="Do not list in directory", null=True + db_column="Do not list in directory", null=True, blank=True + ) + how_did_you_hear = models.TextField( + db_column="HowDidYouHear", null=True, blank=True + ) + authorize_charge = models.TextField( + db_column="authorizeCharge", null=True, blank=True + ) + policy_agreement = models.TextField( + db_column="policyAgreement", null=True, blank=True ) - how_did_you_hear = models.TextField(db_column="HowDidYouHear", null=True) - authorize_charge = models.TextField(db_column="authorizeCharge", null=True) - policy_agreement = models.TextField(db_column="policyAgreement", null=True) waiver_form_signed_and_on_file_date = models.DateField( - db_column="Waiver form signed and on file date.", null=True + db_column="Waiver form signed and on file date.", null=True, blank=True ) membership_agreement_signed_and_on_file_date = models.DateField( - db_column="Membership Agreement signed and on file date.", null=True + db_column="Membership Agreement signed and on file date.", null=True, blank=True + ) + ip_address = models.TextField(db_column="IP Address", null=True, blank=True) + audit_date = models.DateField(db_column="Audit Date", null=True, blank=True) + agreement_version = models.TextField( + db_column="Agreement Version", null=True, blank=True + ) + paperwork_status = models.TextField( + db_column="Paperwork status", null=True, blank=True ) - ip_address = models.TextField(db_column="IP Address", null=True) - audit_date = models.DateField(db_column="Audit Date", null=True) - agreement_version = models.TextField(db_column="Agreement Version", null=True) - paperwork_status = models.TextField(db_column="Paperwork status", null=True) membership_agreement_dated = models.BooleanField( db_column="Membership agreement dated" )