2021-03-23 17:08:00 -04:00
|
|
|
from django.db import models
|
|
|
|
|
2022-02-03 13:45:58 -05:00
|
|
|
from membershipworks.models import Member
|
2021-03-23 17:11:11 -04:00
|
|
|
|
|
|
|
|
2021-03-23 17:08:00 -04:00
|
|
|
class CmsRedRiverVeteransScholarship(models.Model):
|
|
|
|
serial = models.AutoField(primary_key=True)
|
|
|
|
program_name = models.CharField(db_column='Program Name', max_length=255)
|
|
|
|
member_name = models.CharField(db_column='Member Name', max_length=255, blank=True, null=True)
|
|
|
|
discount_percent = models.DecimalField(db_column='Discount Percent', max_digits=16, decimal_places=0, blank=True, null=True)
|
|
|
|
discount_code = models.CharField(db_column='Discount Code', max_length=255, blank=True, null=True)
|
|
|
|
membership_code = models.CharField(db_column='Membership Code', max_length=255, blank=True, null=True)
|
|
|
|
start_date = models.DateField(db_column='Start Date', blank=True, null=True)
|
|
|
|
end_date = models.DateField(db_column='End Date', blank=True, null=True)
|
|
|
|
program_amount = models.DecimalField(db_column='Program Amount', max_digits=16, decimal_places=0, blank=True, null=True)
|
|
|
|
program_status = models.CharField(db_column='Program Status', max_length=16, blank=True, null=True)
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return f"{self.program_name} {self.member_name}"
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
db_table = 'CMS Red River Veterans Scholarship'
|
|
|
|
|
|
|
|
|
|
|
|
class CertificationDefinition(models.Model):
|
|
|
|
certification_identifier = models.AutoField(db_column='Certification Identifier', primary_key=True)
|
|
|
|
certification_name = models.CharField(db_column='Certification Name', max_length=255, blank=True, null=True)
|
|
|
|
department = models.CharField(db_column='Department', max_length=255, blank=True, null=True)
|
|
|
|
|
|
|
|
def __str__(self):
|
2021-04-29 14:01:07 -04:00
|
|
|
return f"{self.certification_name} <{self.department}>"
|
2021-03-23 17:08:00 -04:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
db_table = 'Certification Definitions'
|
2021-04-29 14:01:07 -04:00
|
|
|
ordering = ('certification_name', 'department')
|
2021-03-23 17:08:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
class Certification(models.Model):
|
|
|
|
number = models.AutoField(db_column='Number', primary_key=True)
|
|
|
|
certification = models.ForeignKey(CertificationDefinition, on_delete=models.PROTECT, db_column='Certification')
|
|
|
|
name = models.CharField(db_column='Name', max_length=255)
|
2022-02-03 16:17:33 -05:00
|
|
|
member = models.ForeignKey(Member, on_delete=models.PROTECT, to_field='uid', db_column='uid', blank=True, null=True, db_constraint=False)
|
2021-03-23 17:08:00 -04:00
|
|
|
certified_by = models.CharField(db_column='Certified_By', max_length=255, blank=True, null=True)
|
|
|
|
date = models.DateField(db_column='Date', blank=True, null=True)
|
|
|
|
version = models.CharField(db_column='Version', max_length=255, blank=True, null=True)
|
|
|
|
shop_lead_notified = models.DateTimeField(db_column='Shop Lead Notified', blank=True, null=True)
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return f"{self.name} - {self.certification} [{self.version}]"
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
db_table = 'Certifications'
|
|
|
|
|
|
|
|
|
|
|
|
class InstructorOrVendor(models.Model):
|
|
|
|
serial = models.AutoField(primary_key=True)
|
|
|
|
name = models.CharField(db_column='Name', max_length=255)
|
|
|
|
instructor_agreement_date = models.DateField(db_column='Instructor Agreement Date', blank=True, null=True)
|
|
|
|
w9_date = models.DateField(db_column='W9 date', blank=True, null=True)
|
|
|
|
phone = models.CharField(max_length=255, blank=True, null=True)
|
|
|
|
email_address = models.CharField(db_column='email address', max_length=255, blank=True, null=True)
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return f"{self.name}"
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
db_table = 'Instructors and Vendors'
|
|
|
|
|
|
|
|
|
|
|
|
class SpecialProgram(models.Model):
|
|
|
|
program_name = models.CharField(db_column='Program Name', primary_key=True, max_length=255)
|
|
|
|
discount_percent = models.DecimalField(db_column='Discount Percent', max_digits=16, decimal_places=0, blank=True, null=True)
|
|
|
|
discount_code = models.CharField(db_column='Discount Code', max_length=255, blank=True, null=True)
|
|
|
|
membership_code = models.CharField(db_column='Membership Code', max_length=255, blank=True, null=True)
|
|
|
|
start_date = models.DateField(db_column='Start Date', blank=True, null=True)
|
|
|
|
end_date = models.DateField(db_column='End Date', blank=True, null=True)
|
|
|
|
program_amount = models.DecimalField(db_column='Program Amount', max_digits=16, decimal_places=0, blank=True, null=True)
|
|
|
|
program_status = models.CharField(db_column='Program Status', max_length=16, blank=True, null=True)
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.program_name
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
db_table = 'Special_Programs'
|
|
|
|
|
|
|
|
|
|
|
|
class Waiver(models.Model):
|
|
|
|
number = models.AutoField(db_column='Number', primary_key=True)
|
|
|
|
name = models.CharField(db_column='Name', max_length=255)
|
|
|
|
date = models.DateField(db_column='Date')
|
|
|
|
emergency_contact_name = models.CharField(db_column='Emergency Contact Name', max_length=255, blank=True, null=True)
|
|
|
|
emergency_contact_number = models.CharField(db_column='Emergency Contact Number', max_length=25, blank=True, null=True)
|
|
|
|
waiver_version = models.CharField(db_column='Waiver version', max_length=64)
|
|
|
|
guardian_name = models.CharField(db_column='Guardian Name', max_length=255, blank=True, null=True)
|
|
|
|
guardian_relation = models.CharField(db_column='Guardian Relation', max_length=255, blank=True, null=True)
|
|
|
|
guardian_date = models.DateField(db_column='Guardian Date', blank=True, null=True)
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return f"{self.name} {self.date}"
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
db_table = 'Waivers'
|