Feat: Apply for Founding Partner Program page hookup fixed and hooked up to rest of app through Home page.

This commit is contained in:
2025-08-02 18:33:36 +01:00
parent 438909b102
commit 354260d222
18 changed files with 292 additions and 329 deletions

View File

@@ -10,6 +10,7 @@ Feature: Apply_Founding_Partner_Form Business Object
# internal
from business_objects.base import Base
from business_objects.db_base import SQLAlchemy_ABC
from business_objects.project_hub.contact_form import Contact_Form
import lib.argument_validation as av
from extensions import db
from helpers.helper_app import Helper_App
@@ -23,10 +24,12 @@ class Apply_Founding_Partner_Form(SQLAlchemy_ABC, Base):
FLAG_COMMITMENT_FREQUENCY: ClassVar[str] = 'id_commitment_frequency'
FLAG_DOG_COUNT: ClassVar[str] = 'dog-count'
FLAG_EXISTING_CHALLENGES: ClassVar[str] = 'existing_challenges'
FLAG_EXISTING_SYSTEM: ClassVar[str] = 'id_existing_system'
FLAG_EXISTING_SYSTEM: ClassVar[str] = 'ids_existing_system'
FLAG_EXISTING_TIME_SINK_WEEKLY: ClassVar[str] = 'id_existing_time_sink_weekly'
# FLAG_MOST_VALUABLE_FEATURE: ClassVar[str] = 'most_valuable_feature'
FLAG_SPECIALITY: ClassVar[str] = 'id_speciality'
FLAG_NAME_COMPANY: ClassVar[str] = Contact_Form.FLAG_NAME_COMPANY
FLAG_NAME_CONTACT: ClassVar[str] = Contact_Form.FLAG_NAME_CONTACT
FLAG_SPECIALITY: ClassVar[str] = 'ids_speciality'
FLAG_YEARS_OF_EXPERIENCE: ClassVar[str] = 'id_years_of_experience'
NAME_ATTR_OPTION_VALUE: ClassVar[str] = FLAG_APPLY_FOUNDING_PARTNER_FORM
NAME_ATTR_OPTION_TEXT: ClassVar[str] = Base.FLAG_EMAIL
@@ -44,7 +47,7 @@ class Apply_Founding_Partner_Form(SQLAlchemy_ABC, Base):
id_years_of_experience = db.Column(db.Integer)
ids_speciality = db.Column(db.String(255))
ids_existing_system = db.Column(db.String(255))
id_existing_challenges = db.Column(db.Integer)
existing_challenges = db.Column(db.Integer)
id_existing_time_sink_weekly = db.Column(db.Integer)
id_commitment_frequency = db.Column(db.Integer)
# most_valuable_feature = db.Column(db.Integer)
@@ -71,7 +74,7 @@ class Apply_Founding_Partner_Form(SQLAlchemy_ABC, Base):
form.id_years_of_experience = query_row[4]
form.ids_speciality = query_row[2]
form.ids_existing_system = query_row[3]
form.id_existing_challenges = query_row[4]
form.existing_challenges = query_row[4]
form.id_existing_time_sink_weekly = query_row[2]
form.id_commitment_frequency = query_row[3]
# form.most_valuable_feature = query_row[4]
@@ -92,12 +95,12 @@ class Apply_Founding_Partner_Form(SQLAlchemy_ABC, Base):
form.name_contact = json[cls.FLAG_NAME_CONTACT]
form.website = json[cls.FLAG_WEBSITE]
form.dog_count = json[cls.FLAG_DOG_COUNT]
form.years_of_experience = json[cls.FLAG_YEARS_OF_EXPERIENCE]
form.speciality = json[cls.FLAG_SPECIALITY]
form.existing_system = json[cls.FLAG_EXISTING_SYSTEM]
form.id_years_of_experience = json[cls.FLAG_YEARS_OF_EXPERIENCE]
form.ids_speciality = json[cls.FLAG_SPECIALITY]
form.ids_existing_system = json[cls.FLAG_EXISTING_SYSTEM]
form.existing_challenges = json[cls.FLAG_EXISTING_CHALLENGES]
form.existing_time_sink_weekly = json[cls.FLAG_EXISTING_TIME_SINK_WEEKLY]
form.commitment_frequency = json[cls.FLAG_COMMITMENT_FREQUENCY]
form.id_existing_time_sink_weekly = json[cls.FLAG_EXISTING_TIME_SINK_WEEKLY]
form.id_commitment_frequency = json[cls.FLAG_COMMITMENT_FREQUENCY]
# form.most_valuable_feature = json[cls.FLAG_MOST_VALUABLE_FEATURE]
form.notes = json[cls.FLAG_NOTES]
form.active = av.input_bool(json[cls.FLAG_ACTIVE], cls.FLAG_ACTIVE, _m)
@@ -107,18 +110,18 @@ class Apply_Founding_Partner_Form(SQLAlchemy_ABC, Base):
def to_json(self):
return {
Contact_Form.FLAG_NAME_CONTACT: self.contact_name
Contact_Form.FLAG_NAME_CONTACT: self.name_contact
, Base.FLAG_EMAIL: self.email
, Base.FLAG_PHONE_NUMBER: self.phone_number
, Contact_Form.FLAG_NAME_COMPANY: self.company_name
, Contact_Form.FLAG_NAME_COMPANY: self.name_company
, Base.FLAG_WEBSITE: self.website
, Apply_Founding_Partner_Form.FLAG_DOG_COUNT: self.dog_count
, Apply_Founding_Partner_Form.FLAG_YEARS_OF_EXPERIENCE: self.years_of_experience
, Apply_Founding_Partner_Form.FLAG_SPECIALITY: self.speciality
, Apply_Founding_Partner_Form.FLAG_EXISTING_SYSTEM: self.existing_system
, Apply_Founding_Partner_Form.FLAG_YEARS_OF_EXPERIENCE: self.id_years_of_experience
, Apply_Founding_Partner_Form.FLAG_SPECIALITY: self.ids_speciality
, Apply_Founding_Partner_Form.FLAG_EXISTING_SYSTEM: self.ids_existing_system
, Apply_Founding_Partner_Form.FLAG_EXISTING_CHALLENGES: self.existing_challenges
, Apply_Founding_Partner_Form.FLAG_EXISTING_TIME_SINK_WEEKLY: self.existing_time_sink_weekly
, Apply_Founding_Partner_Form.FLAG_COMMITMENT_FREQUENCY: self.commitment_frequency
, Apply_Founding_Partner_Form.FLAG_EXISTING_TIME_SINK_WEEKLY: self.id_existing_time_sink_weekly
, Apply_Founding_Partner_Form.FLAG_COMMITMENT_FREQUENCY: self.id_commitment_frequency
# , Apply_Founding_Partner_Form.FLAG_IMPLEMENTATION_TIMELINE: self.implementation_timeline
# , Apply_Founding_Partner_Form.FLAG_MOST_VALUABLE_FEATURE: self.most_valuable_feature
, Apply_Founding_Partner_Form.FLAG_NOTES: self.notes
@@ -130,19 +133,19 @@ class Apply_Founding_Partner_Form(SQLAlchemy_ABC, Base):
def __repr__(self):
return f'''
{self.__class__.__name__}(
{self.FLAG_CONTACT_FORM}: {self.id_apply_founding_partner_form}
{Contact_Form.FLAG_NAME_CONTACT}: {self.contact_name}
{self.FLAG_APPLY_FOUNDING_PARTNER_FORM}: {self.id_apply_founding_partner_form}
{Contact_Form.FLAG_NAME_CONTACT}: {self.name_contact}
{Base.FLAG_EMAIL}: {self.email}
{Base.FLAG_PHONE_NUMBER}: {self.phone_number}
{Contact_Form.FLAG_NAME_COMPANY}: {self.company_name}
{Contact_Form.FLAG_NAME_COMPANY}: {self.name_company}
{Base.FLAG_WEBSITE}: {self.website}
{Apply_Founding_Partner_Form.FLAG_DOG_COUNT}: {self.dog_count}
{Apply_Founding_Partner_Form.FLAG_YEARS_OF_EXPERIENCE}: {self.years_of_experience}
{Apply_Founding_Partner_Form.FLAG_SPECIALITY}: {self.speciality}
{Apply_Founding_Partner_Form.FLAG_EXISTING_SYSTEM}: {self.existing_system}
{Apply_Founding_Partner_Form.FLAG_YEARS_OF_EXPERIENCE}: {self.id_years_of_experience}
{Apply_Founding_Partner_Form.FLAG_SPECIALITY}: {self.ids_speciality}
{Apply_Founding_Partner_Form.FLAG_EXISTING_SYSTEM}: {self.ids_existing_system}
{Apply_Founding_Partner_Form.FLAG_EXISTING_CHALLENGES}: {self.existing_challenges}
{Apply_Founding_Partner_Form.FLAG_EXISTING_TIME_SINK_WEEKLY}: {self.existing_time_sink_weekly}
{Apply_Founding_Partner_Form.FLAG_COMMITMENT_FREQUENCY}: {self.commitment_frequency}
{Apply_Founding_Partner_Form.FLAG_EXISTING_TIME_SINK_WEEKLY}: {self.id_existing_time_sink_weekly}
{Apply_Founding_Partner_Form.FLAG_COMMITMENT_FREQUENCY}: {self.id_commitment_frequency}
{Apply_Founding_Partner_Form.FLAG_NOTES}: {self.notes}
{Base.FLAG_ACTIVE}: {self.active}
{Base.FLAG_CREATED_ON}: {self.created_on}
@@ -163,7 +166,7 @@ class Apply_Founding_Partner_Form_Temp(db.Model, Base):
id_years_of_experience = db.Column(db.Integer)
ids_speciality = db.Column(db.String(255))
ids_existing_system = db.Column(db.String(255))
id_existing_challenges = db.Column(db.Integer)
existing_challenges = db.Column(db.Integer)
id_existing_time_sink_weekly = db.Column(db.Integer)
id_commitment_frequency = db.Column(db.Integer)
# most_valuable_feature = db.Column(db.Integer)
@@ -176,23 +179,23 @@ class Apply_Founding_Partner_Form_Temp(db.Model, Base):
super().__init__()
@classmethod
def from_contact_form(cls, contact_form):
_m = f'{cls.__qualname__}.from_contact_form'
def from_apply_founding_partner_form(cls, contact_form):
_m = f'{cls.__qualname__}.from_apply_founding_partner_form'
temp = cls()
temp.id_apply_founding_partner_form = contact_form.id_apply_founding_partner_form.data
temp.name_contact = contact_form.name_contact.data
temp.email = contact_form.email.data
temp.phone_number = contact_form.phone_number.data
temp.name_company = contact_form.name_company.data
temp.website = contact_form.website.data
temp.dog_count = contact_form.dog_count.data
temp.id_years_of_experience = contact_form.id_years_of_experience.data
temp.ids_speciality = contact_form.ids_speciality.data
temp.ids_existing_system = contact_form.ids_existing_system.data
temp.id_existing_challenges = contact_form.id_existing_challenges.data
temp.id_existing_time_sink_weekly = contact_form.id_existing_time_sink_weekly.data
temp.id_commitment_frequency = contact_form.id_commitment_frequency.data
# temp.most_valuable_feature = contact_form.most_valuable_feature.data
temp.notes = contact_form.notes.data
temp.id_apply_founding_partner_form = contact_form.id_apply_founding_partner_form
temp.name_contact = contact_form.name_contact
temp.email = contact_form.email
temp.phone_number = contact_form.phone_number
temp.name_company = contact_form.name_company
temp.website = contact_form.website
temp.dog_count = contact_form.dog_count
temp.id_years_of_experience = contact_form.id_years_of_experience
temp.ids_speciality = contact_form.ids_speciality
temp.ids_existing_system = contact_form.ids_existing_system
temp.existing_challenges = contact_form.existing_challenges
temp.id_existing_time_sink_weekly = contact_form.id_existing_time_sink_weekly
temp.id_commitment_frequency = contact_form.id_commitment_frequency
# temp.most_valuable_feature = contact_form.most_valuable_feature
temp.notes = contact_form.notes
temp.active = True
return temp