Esempio n. 1
0
class Note(models.Model):
    title = models.CharField(max_length=80)
    body = models.TextField(null=True)
    parent_id = models.CharField(max_length=18)
    parent_type = models.CharField(max_length=50,
                                   db_column='Parent.Type',
                                   sf_read_only=models.READ_ONLY)
Esempio n. 2
0
class CommonAccount(DefaultMixin, SalesforceModel):
    """Common fields of Salesforce Account model."""
    description = models.TextField()
    phone = models.CharField(max_length=255)

    class Meta:
        abstract = True
Esempio n. 3
0
class Attachment(models.Model):
    # A standard SFDC object that can have a relationship to any custom object
    name = models.CharField(max_length=80)
    parent = models.ForeignKey(Test,
                               sf_read_only=models.NOT_UPDATEABLE,
                               on_delete=models.DO_NOTHING)
    # The "body" of Attachment can't be queried for more rows togehter.
    body = models.TextField()
Esempio n. 4
0
class Attachment(models.Model):
    ''' Creamos el modelo de Attachment de acuerdo como esta en Salesforce '''
    # A standard SFDC object that can have a relationship to any custom object
    name = models.CharField(max_length=255)
    parent = models.ForeignKey(Provision,
                               sf_read_only=models.NOT_UPDATEABLE,
                               on_delete=models.DO_NOTHING)
    # The "body" of Attachment can't be queried for more rows togehter.
    body = models.TextField()
Esempio n. 5
0
class Account(models.Model):
    is_deleted = models.BooleanField(verbose_name="Deleted",
                                     sf_read_only=models.READ_ONLY,
                                     default=False)
    master_record = models.ForeignKey(
        "self",
        models.DO_NOTHING,
        related_name="account_masterrecord_set",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    name = models.CharField(max_length=255, verbose_name="Account Name")
    type = models.CharField(
        max_length=40,
        verbose_name="Account Type",
        choices=ACCOUNT_TYPE_CHOICES,
        blank=True,
        null=True,
    )
    parent = models.ForeignKey(
        "self",
        models.DO_NOTHING,
        related_name="account_parent_set",
        blank=True,
        null=True,
    )
    billing_street = models.TextField(blank=True, null=True)
    billing_city = models.CharField(max_length=40, blank=True, null=True)
    billing_state = models.CharField(max_length=80,
                                     verbose_name="Billing State/Province",
                                     blank=True,
                                     null=True)
    billing_postal_code = models.CharField(
        max_length=20,
        verbose_name="Billing Zip/Postal Code",
        blank=True,
        null=True)
    billing_country = models.CharField(max_length=80, blank=True, null=True)
    npe01_systemis_individual = models.BooleanField(
        db_column="npe01__SYSTEMIsIndividual__c",
        custom=True,
        verbose_name="_SYSTEM: IsIndividual",
        default=models.DEFAULTED_ON_CREATE,
        help_text=
        "Indicates whether or not this Account is special for Contacts (Household, One-to-One, Individual) vs a normal Account.",
    )

    class Meta(models.Model.Meta):
        db_table = "Account"
        verbose_name = "Account"
        verbose_name_plural = "Accounts"
        # keyPrefix = '001'

    def __str__(self):
        return "%s" % self.name
Esempio n. 6
0
class Product(models.Model):
    #product_id = models.CharField(db_column='Id',max_length=255)
    name = models.CharField(db_column='Name', max_length=255, verbose_name='Product Name')
    product_code = models.CharField(db_column='ProductCode', max_length=255, blank=True, null=True)
    description = models.TextField(db_column='Description', verbose_name='Product Description', blank=True, null=True)
    is_active = models.BooleanField(db_column='IsActive', verbose_name='Active', default=models.DefaultedOnCreate(False))
    family = models.CharField(db_column='Family', max_length=255, verbose_name='Product Family', choices=[('None', 'None')], blank=True, null=True)
    
    class Meta:
        db_table = 'Product2'
        verbose_name = 'Product'
        verbose_name_plural = 'Products'
Esempio n. 7
0
class Organization(models.Model):
    name = models.CharField(max_length=80, sf_read_only=models.NOT_CREATEABLE)
    division = models.CharField(max_length=80, sf_read_only=models.NOT_CREATEABLE, blank=True)
    street = models.TextField(sf_read_only=models.NOT_CREATEABLE, blank=True)
    city = models.CharField(max_length=40, sf_read_only=models.NOT_CREATEABLE, blank=True)
    country = models.CharField(max_length=80, sf_read_only=models.READ_ONLY, blank=True)
    address = models.TextField(sf_read_only=models.READ_ONLY, blank=True)  # This field type is a guess.
    phone = models.CharField(max_length=40, sf_read_only=models.NOT_CREATEABLE, blank=True)
    instance_name = models.CharField(max_length=5, sf_read_only=models.READ_ONLY, blank=True)
    is_sandbox = models.BooleanField(sf_read_only=models.READ_ONLY)
    created_date = models.DateTimeField(sf_read_only=models.READ_ONLY)
    created_by = models.ForeignKey(User, related_name='organization_createdby_set',
                                   sf_read_only=models.READ_ONLY, on_delete=models.DO_NOTHING)
    last_modified_date = models.DateTimeField(sf_read_only=models.READ_ONLY)
    last_modified_by = models.ForeignKey('User', related_name='organization_lastmodifiedby_set',
                                         sf_read_only=models.READ_ONLY, on_delete=models.DO_NOTHING)

    class Meta(models.Model.Meta):
        db_table = 'Organization'
        verbose_name = 'Organization'
        verbose_name_plural = 'Organizations'
Esempio n. 8
0
class AbstractAccount(SalesforceModel):
    """
	Default Salesforce Account model.
	"""
    TYPES = [
        'Analyst', 'Competitor', 'Customer', 'Integrator', 'Investor',
        'Partner', 'Press', 'Prospect', 'Reseller', 'Other'
    ]

    Owner = models.ForeignKey(User,
                              on_delete=models.DO_NOTHING,
                              default=lambda: User(pk='DEFAULT'),
                              db_column='OwnerId')
    Type = models.CharField(max_length=100,
                            choices=[(x, x) for x in TYPES],
                            null=True)
    BillingStreet = models.CharField(max_length=255)
    BillingCity = models.CharField(max_length=40)
    BillingState = models.CharField(max_length=20)
    BillingPostalCode = models.CharField(max_length=20)
    BillingCountry = models.CharField(max_length=40)
    ShippingStreet = models.CharField(max_length=255)
    ShippingCity = models.CharField(max_length=40)
    ShippingState = models.CharField(max_length=20)
    ShippingPostalCode = models.CharField(max_length=20)
    ShippingCountry = models.CharField(max_length=40)
    Phone = models.CharField(max_length=255)
    Fax = models.CharField(max_length=255)
    Website = models.CharField(max_length=255)
    Industry = models.CharField(max_length=100,
                                choices=[(x, x) for x in INDUSTRIES])
    Description = models.TextField()
    # Added read only option, otherwise the object can not be never saved
    # If the model is used also with non SF databases then there should be set
    # allow_now=True or null=True
    LastModifiedDate = models.DateTimeField(db_column='LastModifiedDate',
                                            sf_read_only=models.READ_ONLY,
                                            auto_now=True)

    class Meta(SalesforceModel.Meta):
        abstract = True

    def __unicode__(self):
        return self.Name
Esempio n. 9
0
class User(models.Model):
    username = models.CharField(max_length=80)
    last_name = models.CharField(max_length=80)
    first_name = models.CharField(max_length=40, blank=True, null=True)
    middle_name = models.CharField(max_length=40, blank=True, null=True)
    suffix = models.CharField(max_length=40, blank=True, null=True)
    name = models.CharField(max_length=121,
                            verbose_name="Full Name",
                            sf_read_only=models.READ_ONLY)
    company_name = models.CharField(max_length=80, blank=True, null=True)
    division = models.CharField(max_length=80, blank=True, null=True)
    department = models.CharField(max_length=80, blank=True, null=True)
    title = models.CharField(max_length=80, blank=True, null=True)
    street = models.TextField(blank=True, null=True)
    city = models.CharField(max_length=40, blank=True, null=True)
    state = models.CharField(max_length=80,
                             verbose_name="State/Province",
                             blank=True,
                             null=True)
    postal_code = models.CharField(max_length=20,
                                   verbose_name="Zip/Postal Code",
                                   blank=True,
                                   null=True)
    country = models.CharField(max_length=80, blank=True, null=True)
    is_active = models.BooleanField(verbose_name="Active",
                                    default=models.DEFAULTED_ON_CREATE)

    class Meta(models.Model.Meta):
        db_table = "User"
        verbose_name = "User"
        verbose_name_plural = "Users"
        # keyPrefix = '003'

    def __str__(self):
        if self.is_active:
            active = "Active"
        else:
            active = "Inactive"
        return "%s %s -- %s" % (self.first_name, self.last_name, active)
Esempio n. 10
0
class Lead(SalesforceModel):
    """
	Default Salesforce Lead model.
	"""
    SOURCES = [
        'Advertisement',
        'Employee Referral',
        'External Referral',
        'Partner',
        'Public Relations',
        'Seminar - Internal',
        'Seminar - Partner',
        'Trade Show',
        'Web',
        'Word of mouth',
        'Other',
    ]

    STATUSES = [
        'Contacted',
        'Open',
        'Qualified',
        'Unqualified',
    ]

    RATINGS = [
        'Hot',
        'Warm',
        'Cold',
    ]

    LastName = models.CharField(max_length=80)
    FirstName = models.CharField(max_length=40)
    Salutation = models.CharField(max_length=100,
                                  choices=[(x, x) for x in SALUTATIONS])
    Salutation = models.CharField(max_length=100,
                                  choices=[(x, x) for x in SALUTATIONS])
    Name = models.CharField(max_length=121, sf_read_only=models.READ_ONLY)
    Title = models.CharField(max_length=128)
    Company = models.CharField(max_length=255)
    Street = models.CharField(max_length=255)
    City = models.CharField(max_length=40)
    State = models.CharField(max_length=20)
    PostalCode = models.CharField(max_length=20)
    Country = models.CharField(max_length=40)
    Phone = models.CharField(max_length=255)
    Email = models.CharField(max_length=100)
    Website = models.CharField(max_length=100)
    Description = models.TextField()
    LeadSource = models.CharField(max_length=100,
                                  choices=[(x, x) for x in SOURCES])
    Status = models.CharField(max_length=100,
                              choices=[(x, x) for x in STATUSES])
    Industry = models.CharField(max_length=100,
                                choices=[(x, x) for x in INDUSTRIES])
    Rating = models.CharField(max_length=100,
                              choices=[(x, x) for x in RATINGS])
    # Added an example of special DateTime field in Salesforce that can
    # not be inserted, but can be updated
    # TODO write test for it
    EmailBouncedDate = models.DateTimeField(blank=True,
                                            null=True,
                                            sf_read_only=models.NOT_CREATEABLE)

    def __unicode__(self):
        return self.Name
Esempio n. 11
0
class Contact(models.Model):
    """Model that maps to Salesforce Contact object."""

    account = models.ForeignKey(Account,
                                models.DO_NOTHING,
                                blank=True,
                                null=True)
    last_name = models.CharField(max_length=80)
    first_name = models.CharField(max_length=40, blank=True, null=True)
    name = models.CharField(max_length=121,
                            verbose_name='Full Name',
                            sf_read_only=models.READ_ONLY)
    email = models.EmailField()
    year_of_birth = models.CharField(custom=True,
                                     db_column='Year_of_Birth__c',
                                     max_length=255,
                                     verbose_name='Year of Birth',
                                     blank=True,
                                     null=True)
    language = models.CharField(custom=True,
                                max_length=255,
                                blank=True,
                                null=True)
    country = models.CharField(custom=True,
                               max_length=255,
                               choices=COUNTRIES,
                               blank=True,
                               null=True)
    pi_utm_campaign = models.CharField(
        db_column='pi__utm_campaign__c',
        custom=True,
        max_length=255,
        verbose_name='Google Analytics Campaign',
        blank=True,
        null=True)
    pi_utm_content = models.CharField(db_column='pi__utm_content__c',
                                      custom=True,
                                      max_length=255,
                                      verbose_name='Google Analytics Content',
                                      blank=True,
                                      null=True)
    pi_utm_medium = models.CharField(db_column='pi__utm_medium__c',
                                     custom=True,
                                     max_length=255,
                                     verbose_name='Google Analytics Medium',
                                     blank=True,
                                     null=True)
    pi_utm_source = models.CharField(db_column='pi__utm_source__c',
                                     custom=True,
                                     max_length=255,
                                     verbose_name='Google Analytics Source',
                                     blank=True,
                                     null=True)
    pi_utm_term = models.CharField(db_column='pi__utm_term__c',
                                   custom=True,
                                   max_length=255,
                                   verbose_name='Google Analytics Term',
                                   blank=True,
                                   null=True)
    registration_date = models.DateTimeField(custom=True,
                                             db_column='Registration_Date__c',
                                             verbose_name='Registration Date',
                                             blank=True,
                                             null=True)
    level_of_education = models.CharField(custom=True,
                                          db_column='Level_of_Education__c',
                                          max_length=255,
                                          verbose_name='Level of Education',
                                          blank=True,
                                          null=True)
    interest = models.TextField(custom=True, blank=True)
    gender = models.CharField(custom=True,
                              max_length=255,
                              blank=True,
                              null=True)

    class Meta(models.Model.Meta):
        db_table = 'Contact'
        verbose_name = 'Contact'
        verbose_name_plural = 'Contacts'

    def __unicode__(self):
        """Return unicode representation of object."""
        return self.name
Esempio n. 12
0
class Lead(models.Model):
    """Model that maps to Salesforce Lead object."""

    last_name = models.CharField(max_length=80)
    first_name = models.CharField(max_length=40, blank=True, null=True)
    company = models.CharField(max_length=255, verbose_name='Organization')
    email = models.EmailField()
    status = models.CharField(max_length=40,
                              default=models.DEFAULTED_ON_CREATE)
    is_converted = models.BooleanField(verbose_name='Converted',
                                       sf_read_only=models.NOT_UPDATEABLE,
                                       default=models.DEFAULTED_ON_CREATE)
    converted_account = models.ForeignKey(Account,
                                          models.DO_NOTHING,
                                          sf_read_only=models.READ_ONLY,
                                          blank=True,
                                          null=True)
    converted_contact = models.ForeignKey(Contact,
                                          models.DO_NOTHING,
                                          sf_read_only=models.READ_ONLY,
                                          blank=True,
                                          null=True)
    username = models.CharField(custom=True, max_length=100)
    year_of_birth = models.CharField(custom=True,
                                     db_column='Year_of_Birth__c',
                                     max_length=255,
                                     verbose_name='Year of Birth',
                                     blank=True,
                                     null=True)
    language = models.CharField(custom=True,
                                max_length=255,
                                blank=True,
                                null=True)
    country = models.CharField(db_column='Country__c',
                               custom=True,
                               max_length=255,
                               choices=COUNTRIES,
                               blank=True,
                               null=True)
    pi_utm_campaign = models.CharField(
        db_column='pi__utm_campaign__c',
        custom=True,
        max_length=255,
        verbose_name='Google Analytics Campaign',
        blank=True,
        null=True)
    pi_utm_content = models.CharField(db_column='pi__utm_content__c',
                                      custom=True,
                                      max_length=255,
                                      verbose_name='Google Analytics Content',
                                      blank=True,
                                      null=True)
    pi_utm_medium = models.CharField(db_column='pi__utm_medium__c',
                                     custom=True,
                                     max_length=255,
                                     verbose_name='Google Analytics Medium',
                                     blank=True,
                                     null=True)
    pi_utm_source = models.CharField(db_column='pi__utm_source__c',
                                     custom=True,
                                     max_length=255,
                                     verbose_name='Google Analytics Source',
                                     blank=True,
                                     null=True)
    pi_utm_term = models.CharField(db_column='pi__utm_term__c',
                                   custom=True,
                                   max_length=255,
                                   verbose_name='Google Analytics Term',
                                   blank=True,
                                   null=True)
    programs = models.CharField(custom=True,
                                max_length=4099,
                                default='OpenClassroom')
    registration_date = models.DateTimeField(custom=True,
                                             db_column='Registration_Date__c',
                                             verbose_name='Registration Date',
                                             blank=True,
                                             null=True)
    level_of_education = models.CharField(custom=True,
                                          db_column='Level_of_Education__c',
                                          max_length=255,
                                          verbose_name='Level of Education',
                                          blank=True,
                                          null=True)
    interest = models.TextField(custom=True, blank=True)
    gender = models.CharField(custom=True,
                              max_length=255,
                              blank=True,
                              null=True)

    class Meta(models.Model.Meta):
        db_table = 'Lead'
        verbose_name = 'Lead'
        verbose_name_plural = 'Leads'

    def __unicode__(self):
        """Return unicode representation of object."""
        return self.username
Esempio n. 13
0
class Contact(models.Model):
    is_deleted = models.BooleanField(db_column='IsDeleted',
                                     verbose_name='Eliminado',
                                     sf_read_only=models.READ_ONLY,
                                     default=False)
    master_record = models.ForeignKey('self',
                                      models.DO_NOTHING,
                                      db_column='MasterRecordId',
                                      related_name='contact_masterrecord_set',
                                      verbose_name='Id. de registro principal',
                                      sf_read_only=models.READ_ONLY,
                                      blank=True,
                                      null=True)
    account = models.ForeignKey('Account',
                                models.DO_NOTHING,
                                db_column='AccountId',
                                related_name='contact_account_set',
                                verbose_name='Id. de la cuenta',
                                blank=True,
                                null=True)  # Master Detail Relationship *
    last_name = models.CharField(db_column='LastName',
                                 max_length=80,
                                 verbose_name='Apellidos')
    first_name = models.CharField(db_column='FirstName',
                                  max_length=40,
                                  verbose_name='Nombre',
                                  blank=True,
                                  null=True)
    name = models.CharField(db_column='Name',
                            max_length=121,
                            verbose_name='Nombre completo',
                            sf_read_only=models.READ_ONLY)
    record_type = models.ForeignKey('RecordType',
                                    models.DO_NOTHING,
                                    db_column='RecordTypeId',
                                    verbose_name='Id. de tipo de registro',
                                    blank=True,
                                    null=True)
    other_street = models.TextField(db_column='OtherStreet',
                                    verbose_name='Otra calle',
                                    blank=True,
                                    null=True)
    other_city = models.CharField(db_column='OtherCity',
                                  max_length=40,
                                  verbose_name='Otra ciudad',
                                  blank=True,
                                  null=True)
    other_state = models.CharField(db_column='OtherState',
                                   max_length=80,
                                   verbose_name='Otro estado o provincia',
                                   blank=True,
                                   null=True)
    other_postal_code = models.CharField(db_column='OtherPostalCode',
                                         max_length=20,
                                         verbose_name='Otro código postal',
                                         blank=True,
                                         null=True)
    mailing_street = models.TextField(db_column='MailingStreet',
                                      verbose_name='Calle de correo',
                                      blank=True,
                                      null=True)
    mailing_city = models.CharField(db_column='MailingCity',
                                    max_length=40,
                                    verbose_name='Ciudad de correo',
                                    blank=True,
                                    null=True)
    mailing_state = models.CharField(
        db_column='MailingState',
        max_length=80,
        verbose_name='Estado o provincia de correo',
        blank=True,
        null=True)
    mailing_postal_code = models.CharField(
        db_column='MailingPostalCode',
        max_length=20,
        verbose_name='Código postal de correo',
        blank=True,
        null=True)
    home_phone = models.CharField(db_column='HomePhone',
                                  max_length=40,
                                  verbose_name='Teléfono particular',
                                  blank=True,
                                  null=True)
    email = models.EmailField(db_column='Email',
                              verbose_name='Correo electrónico',
                              blank=True,
                              null=True)
    birthdate = models.DateField(db_column='Birthdate',
                                 verbose_name='Fecha de nacimiento',
                                 blank=True,
                                 null=True)
    gender = models.CharField(db_column='Gender__c',
                              max_length=255,
                              choices=[('Male', 'Male'), ('Female', 'Female'),
                                       ('Other', 'Other')],
                              blank=True,
                              null=True)
    n_mero_de_documento = models.CharField(
        db_column='N_mero_de_Documento__c',
        max_length=18,
        verbose_name='Número de Documento',
        help_text=
        'Debe introducir un DNI valido con 8 dígitos. En caso de que el DNI tenga 7 digitos debe introducirlo con un 0 delante',
        blank=True,
        null=True)
    sexo = models.CharField(db_column='Sexo__c',
                            max_length=255,
                            choices=[('Hombre', 'Hombre'), ('Mujer', 'Mujer'),
                                     ('Otro', 'Otro')],
                            blank=True,
                            null=True)
    cuit_cuil = models.DecimalField(
        db_column='Cuit_Cuil__c',
        unique=True,
        max_digits=11,
        decimal_places=0,
        verbose_name='Cuit/Cuil',
        help_text='Se debe introducir el número sin guiones ni puntos',
        blank=True,
        null=True)
    necesita_recibo = models.CharField(db_column='Necesita_recibo__c',
                                       max_length=255,
                                       verbose_name='¿Necesita recibo?',
                                       choices=[('Sí', 'Sí'), ('No', 'No')],
                                       blank=True,
                                       null=True)
    tipo_de_documento = models.CharField(db_column='Tipo_de_documento__c',
                                         max_length=255,
                                         verbose_name='Tipo de documento',
                                         choices=[('DNI', 'DNI'),
                                                  ('Pasaporte', 'Pasaporte')],
                                         blank=True,
                                         null=True)

    class Meta(models.Model.Meta):
        db_table = 'Contact'
        verbose_name = 'Contacto'
        verbose_name_plural = 'Contactos'
Esempio n. 14
0
class Contact(models.Model):
    is_deleted = models.BooleanField(verbose_name='Deleted',
                                     sf_read_only=models.READ_ONLY)
    master_record = models.ForeignKey('self',
                                      related_name='contact_masterrecord_set',
                                      sf_read_only=models.READ_ONLY,
                                      on_delete=models.DO_NOTHING,
                                      blank=True,
                                      null=True)
    #account = models.ForeignKey('Account', on_delete=models.DO_NOTHING, blank=True, null=True)
    last_name = models.CharField(max_length=80, verbose_name='Last Name')
    first_name = models.CharField(max_length=40,
                                  verbose_name='First Name',
                                  blank=True)
    salutation = models.CharField(max_length=40,
                                  verbose_name='Salutation',
                                  choices=[(u'Mr.', u'Mr.'), (u'Ms.', u'Ms.'),
                                           (u'Mrs.', u'Mrs.'),
                                           (u'Dr.', u'Dr.'),
                                           (u'Prof.', u'Prof.')],
                                  blank=True)
    name = models.CharField(max_length=121,
                            verbose_name='Full Name',
                            sf_read_only=models.READ_ONLY)
    other_street = models.TextField(verbose_name='Other Street', blank=True)
    other_city = models.CharField(max_length=40,
                                  verbose_name='Other City',
                                  blank=True)
    other_state = models.CharField(max_length=80,
                                   verbose_name='Other State/Province',
                                   blank=True)
    other_postal_code = models.CharField(max_length=20,
                                         verbose_name='Other Zip/Postal Code',
                                         blank=True)
    other_country = models.CharField(max_length=80,
                                     verbose_name='Other Country',
                                     blank=True)
    other_latitude = models.DecimalField(max_digits=18,
                                         decimal_places=15,
                                         verbose_name='Other Latitude',
                                         blank=True,
                                         null=True)
    other_longitude = models.DecimalField(max_digits=18,
                                          decimal_places=15,
                                          verbose_name='Other Longitude',
                                          blank=True,
                                          null=True)
    other_address = models.TextField(verbose_name='Other Address',
                                     sf_read_only=models.READ_ONLY,
                                     blank=True)  # This field type is a guess.
    mailing_street = models.TextField(verbose_name='Mailing Street',
                                      blank=True)
    mailing_city = models.CharField(max_length=40,
                                    verbose_name='Mailing City',
                                    blank=True)
    mailing_state = models.CharField(max_length=80,
                                     verbose_name='Mailing State/Province',
                                     blank=True)
    mailing_postal_code = models.CharField(
        max_length=20, verbose_name='Mailing Zip/Postal Code', blank=True)
    mailing_country = models.CharField(max_length=80,
                                       verbose_name='Mailing Country',
                                       blank=True)
    mailing_latitude = models.DecimalField(max_digits=18,
                                           decimal_places=15,
                                           verbose_name='Mailing Latitude',
                                           blank=True,
                                           null=True)
    mailing_longitude = models.DecimalField(max_digits=18,
                                            decimal_places=15,
                                            verbose_name='Mailing Longitude',
                                            blank=True,
                                            null=True)
    mailing_address = models.TextField(
        verbose_name='Mailing Address',
        sf_read_only=models.READ_ONLY,
        blank=True)  # This field type is a guess.
    phone = models.CharField(max_length=40,
                             verbose_name='Business Phone',
                             blank=True)
    fax = models.CharField(max_length=40,
                           verbose_name='Business Fax',
                           blank=True)
    mobile_phone = models.CharField(max_length=40,
                                    verbose_name='Mobile Phone',
                                    blank=True)
    home_phone = models.CharField(max_length=40,
                                  verbose_name='Home Phone',
                                  blank=True)
    other_phone = models.CharField(max_length=40,
                                   verbose_name='Other Phone',
                                   blank=True)
    assistant_phone = models.CharField(max_length=40,
                                       verbose_name='Asst. Phone',
                                       blank=True)
    reports_to = models.ForeignKey('self',
                                   related_name='contact_reportsto_set',
                                   on_delete=models.DO_NOTHING,
                                   blank=True,
                                   null=True)
    email = models.EmailField(verbose_name='Email', blank=True, null=True)
    title = models.CharField(max_length=128, verbose_name='Title', blank=True)
    department = models.CharField(max_length=80,
                                  verbose_name='Department',
                                  blank=True)
    assistant_name = models.CharField(max_length=40,
                                      verbose_name=u"Assistant's Name",
                                      blank=True)
    lead_source = models.CharField(max_length=40,
                                   verbose_name='Lead Source',
                                   choices=[
                                       (u'Web', u'Web'),
                                       (u'Phone Inquiry', u'Phone Inquiry'),
                                       (u'Partner Referral',
                                        u'Partner Referral'),
                                       (u'Purchased List', u'Purchased List'),
                                       (u'Other', u'Other')
                                   ],
                                   blank=True)
    birthdate = models.DateField(verbose_name='Birthdate',
                                 blank=True,
                                 null=True)
    description = models.TextField(verbose_name='Contact Description',
                                   blank=True)
    #owner = models.ForeignKey('User', related_name='contact_owner_set', on_delete=models.DO_NOTHING)
    #created_date = models.DateTimeField(verbose_name='Created Date', sf_read_only=models.READ_ONLY)
    #created_by = models.ForeignKey('User', related_name='contact_createdby_set', sf_read_only=models.READ_ONLY, on_delete=models.DO_NOTHING)
    last_modified_date = models.DateTimeField(
        verbose_name='Last Modified Date', sf_read_only=models.READ_ONLY)
    #last_modified_by = models.ForeignKey('User', related_name='contact_lastmodifiedby_set', sf_read_only=models.READ_ONLY, on_delete=models.DO_NOTHING)
    system_modstamp = models.DateTimeField(verbose_name='System Modstamp',
                                           sf_read_only=models.READ_ONLY)
    last_activity_date = models.DateField(verbose_name='Last Activity',
                                          sf_read_only=models.READ_ONLY,
                                          blank=True,
                                          null=True)
    last_curequest_date = models.DateTimeField(
        db_column='LastCURequestDate',
        verbose_name='Last Stay-in-Touch Request Date',
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True)
    last_cuupdate_date = models.DateTimeField(
        db_column='LastCUUpdateDate',
        verbose_name='Last Stay-in-Touch Save Date',
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True)
    last_viewed_date = models.DateTimeField(verbose_name='Last Viewed Date',
                                            sf_read_only=models.READ_ONLY,
                                            blank=True,
                                            null=True)
    last_referenced_date = models.DateTimeField(
        verbose_name='Last Referenced Date',
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True)
    email_bounced_reason = models.CharField(
        max_length=255, verbose_name='Email Bounced Reason', blank=True)
    email_bounced_date = models.DateTimeField(
        verbose_name='Email Bounced Date', blank=True, null=True)
    is_email_bounced = models.BooleanField(verbose_name='Is Email Bounced',
                                           sf_read_only=models.READ_ONLY)

    class Meta(models.Model.Meta):
        db_table = 'Contact'
        verbose_name = 'Contact'
        verbose_name_plural = 'Contacts'
Esempio n. 15
0
class Contact(models.Model):
    is_deleted = models.BooleanField(verbose_name="Deleted",
                                     sf_read_only=models.READ_ONLY,
                                     default=False)
    master_record = models.ForeignKey(
        "self",
        models.DO_NOTHING,
        related_name="contact_masterrecord_set",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    account = models.ForeignKey(
        Account,
        models.DO_NOTHING,
        related_name="contact_account_set",
        blank=True,
        null=True,
    )  # Master Detail Relationship *
    last_name = models.CharField(max_length=80)
    first_name = models.CharField(max_length=40, blank=True, null=True)
    salutation = models.CharField(max_length=40,
                                  choices=SALUTATION_CHOICES,
                                  blank=True,
                                  null=True)
    middle_name = models.CharField(max_length=40, blank=True, null=True)
    suffix = models.CharField(max_length=40, blank=True, null=True)
    name = models.CharField(max_length=121,
                            verbose_name="Full Name",
                            sf_read_only=models.READ_ONLY)
    mailing_street = models.TextField(blank=True, null=True)
    mailing_city = models.CharField(max_length=40, blank=True, null=True)
    mailing_state = models.CharField(max_length=80,
                                     verbose_name="Mailing State/Province",
                                     blank=True,
                                     null=True)
    mailing_postal_code = models.CharField(
        max_length=20,
        verbose_name="Mailing Zip/Postal Code",
        blank=True,
        null=True)
    mailing_country = models.CharField(max_length=80, blank=True, null=True)
    mailing_state_code = models.CharField(
        max_length=10,
        verbose_name="Mailing State/Province Code",
        choices=STATE_CHOICES,
        blank=True,
        null=True,
    )
    mailing_country_code = models.CharField(
        max_length=10,
        default=models.DEFAULTED_ON_CREATE,
        choices=STATE_CHOICES,
        blank=True,
        null=True,
    )
    mobile_phone = models.CharField(max_length=40, blank=True, null=True)
    home_phone = models.CharField(max_length=40, blank=True, null=True)
    other_phone = models.CharField(max_length=40, blank=True, null=True)
    email = models.EmailField(blank=True, null=True)
    title = models.CharField(max_length=128, blank=True, null=True)
    department = models.CharField(max_length=80, blank=True, null=True)
    birthdate = models.DateField(blank=True, null=True)
    owner = models.ForeignKey("User",
                              models.DO_NOTHING,
                              related_name="contact_owner_set",
                              blank=True)
    created_date = models.DateTimeField(sf_read_only=models.READ_ONLY)
    created_by = models.ForeignKey(
        "User",
        models.DO_NOTHING,
        related_name="contact_createdby_set",
        sf_read_only=models.READ_ONLY,
    )
    last_modified_date = models.DateTimeField(sf_read_only=models.READ_ONLY)
    last_modified_by = models.ForeignKey(
        "User",
        models.DO_NOTHING,
        related_name="contact_lastmodifiedby_set",
        sf_read_only=models.READ_ONLY,
    )
    system_modstamp = models.DateTimeField(sf_read_only=models.READ_ONLY)
    last_activity_date = models.DateField(
        verbose_name="Last Activity",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    last_curequest_date = models.DateTimeField(
        db_column="LastCURequestDate",
        verbose_name="Last Stay-in-Touch Request Date",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    last_cuupdate_date = models.DateTimeField(
        db_column="LastCUUpdateDate",
        verbose_name="Last Stay-in-Touch Save Date",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    last_viewed_date = models.DateTimeField(sf_read_only=models.READ_ONLY,
                                            blank=True,
                                            null=True)
    last_referenced_date = models.DateTimeField(sf_read_only=models.READ_ONLY,
                                                blank=True,
                                                null=True)
    email_bounced_reason = models.CharField(max_length=255,
                                            blank=True,
                                            null=True)
    email_bounced_date = models.DateTimeField(blank=True, null=True)
    is_email_bounced = models.BooleanField(sf_read_only=models.READ_ONLY,
                                           default=False)
    photo_url = models.URLField(verbose_name="Photo URL",
                                sf_read_only=models.READ_ONLY,
                                blank=True,
                                null=True)
    jigsaw_contact_id = models.CharField(
        max_length=20,
        verbose_name="Jigsaw Contact ID",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    individual = models.ForeignKey("Individual",
                                   models.DO_NOTHING,
                                   blank=True,
                                   null=True)
    race = models.CharField(
        custom=True,
        max_length=255,
        verbose_name="Which best describes your race?",
        choices=RACE_CHOICES,
        blank=True,
        null=True,
    )
    gender = models.CharField(custom=True,
                              max_length=255,
                              choices=GENDER_CHOICES,
                              blank=True,
                              null=True)
    which_best_describes_your_ethnicity = models.CharField(
        custom=True,
        db_column="Which_best_describes_your_ethnicity__c",
        max_length=255,
        verbose_name="Which best describes your ethnicity?",
        choices=ETHNICITY_CHOICES,
        blank=True,
        null=True,
    )
    expected_graduation_year = models.CharField(
        custom=True,
        db_column="Expected_graduation_year__c",
        max_length=4,
        verbose_name="Expected graduation year",
        help_text=
        "Enter the year this contact is expected to graduate.  For example, 2020",
        blank=True,
        null=True,
    )
    current_grade_level = models.CharField(
        custom=True,
        db_column="Current_grade_level__c",
        max_length=1300,
        verbose_name="Current grade level",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    volunteer_area_s_of_interest = models.CharField(
        custom=True,
        db_column="Volunteer_area_s_of_interest__c",
        max_length=4099,
        verbose_name="Volunteer area(s) of interest",
        choices=[("Classroom", "Classroom"), ("Event", "Event"),
                 ("Other", "Other")],
        blank=True,
        null=True,
    )
    enrollments_this_semester_applied = models.DecimalField(
        custom=True,
        db_column="enrollments_this_semester_Applied__c",
        max_digits=2,
        decimal_places=0,
        verbose_name="# enrollments this semester - Applied",
        help_text="DO NOT EDIT - AUTO-POPULATED BY SYSTEM",
        blank=True,
        null=True,
    )
    enrollments_this_semester_waitlisted = models.DecimalField(
        custom=True,
        db_column="enrollments_this_semester_Waitlisted__c",
        max_digits=2,
        decimal_places=0,
        verbose_name="# enrollments this semester - Waitlisted",
        help_text="DO NOT EDIT - AUTO-POPULATED BY SYSTEM",
        blank=True,
        null=True,
    )
    enrollments_this_semester_rejected = models.DecimalField(
        custom=True,
        db_column="enrollments_this_semester_Rejected__c",
        max_digits=2,
        decimal_places=0,
        verbose_name="# enrollments this semester - Rejected",
        help_text="DO NOT EDIT - AUTO-POPULATED BY SYSTEM",
        blank=True,
        null=True,
    )
    enrollments_this_semester_drop_out = models.DecimalField(
        custom=True,
        db_column="enrollments_this_semester_Drop_out__c",
        max_digits=2,
        decimal_places=0,
        verbose_name="# enrollments this semester - Drop out",
        help_text="DO NOT EDIT - AUTO-POPULATED BY SYSTEM",
        blank=True,
        null=True,
    )
    race_other = models.CharField(
        custom=True,
        db_column="Race_Other__c",
        max_length=100,
        verbose_name="Which best describes your race? (Other)",
        blank=True,
        null=True,
    )
    gender_other = models.CharField(
        custom=True,
        db_column="Gender_Other__c",
        max_length=50,
        verbose_name="Gender (Other)",
        blank=True,
        null=True,
    )
    parent_guardian_first_name = models.CharField(
        custom=True,
        db_column="Parent_Guardian_first_name__c",
        max_length=100,
        verbose_name="Parent/Guardian first name",
        blank=True,
        null=True,
    )
    parent_guardian_last_name = models.CharField(
        custom=True,
        db_column="Parent_Guardian_last_name__c",
        max_length=100,
        verbose_name="Parent/Guardian last name",
        blank=True,
        null=True,
    )
    parent_guardian_phone = models.CharField(
        custom=True,
        db_column="Parent_Guardian_phone__c",
        max_length=40,
        verbose_name="Parent/Guardian phone",
        blank=True,
        null=True,
    )
    parent_guardian_email = models.EmailField(
        custom=True,
        db_column="Parent_Guardian_email__c",
        verbose_name="Parent/Guardian email",
        blank=True,
        null=True,
    )
    dm_current_grade = models.CharField(
        custom=True,
        db_column="DM_Current_grade__c",
        max_length=255,
        verbose_name="DM - Current grade",
        help_text=
        "Need this for data migration to calculate Expected Graduation Year?  If not, delete this field.",
        choices=CURRENT_GRADE_CHOICES,
        blank=True,
        null=True,
    )
    client_id = models.CharField(
        custom=True,
        db_column="Client_ID__c",
        max_length=14,
        verbose_name="Client ID",
        help_text=
        '3 first letters of first name, 3 first letters of last name, and birthdate "AAABBB00000000" (Only used for students and parents). This field is auto-populated by FormAssembly.',
        blank=True,
        null=True,
    )
    npsp_primary_affiliation = models.ForeignKey(
        Account,
        models.DO_NOTHING,
        db_column="npsp__Primary_Affiliation__c",
        custom=True,
        related_name="contact_npspprimaryaffiliation_set",
        blank=True,
        null=True,
    )

    class Meta(models.Model.Meta):
        db_table = "Contact"
        verbose_name = "Contact"
        verbose_name_plural = "Contacts"
        # keyPrefix = '003'

    def __str__(self):
        return "%s %s" % (self.first_name, self.last_name)
Esempio n. 16
0
class ClassEnrollment(models.Model):
    is_deleted = models.BooleanField(verbose_name="Deleted",
                                     sf_read_only=models.READ_ONLY,
                                     default=False)
    name = models.CharField(max_length=80,
                            verbose_name="Class Enrollment #",
                            sf_read_only=models.READ_ONLY)
    created_date = models.DateTimeField(sf_read_only=models.READ_ONLY)
    created_by = models.ForeignKey(
        "User",
        models.DO_NOTHING,
        related_name="classenrollment_createdby_set",
        sf_read_only=models.READ_ONLY,
    )
    last_modified_date = models.DateTimeField(sf_read_only=models.READ_ONLY)
    last_modified_by = models.ForeignKey(
        "User",
        models.DO_NOTHING,
        related_name="classenrollment_lastmodifiedby_set",
        sf_read_only=models.READ_ONLY,
    )
    system_modstamp = models.DateTimeField(sf_read_only=models.READ_ONLY)
    last_activity_date = models.DateField(sf_read_only=models.READ_ONLY,
                                          blank=True,
                                          null=True)
    last_viewed_date = models.DateTimeField(sf_read_only=models.READ_ONLY,
                                            blank=True,
                                            null=True)
    last_referenced_date = models.DateTimeField(sf_read_only=models.READ_ONLY,
                                                blank=True,
                                                null=True)
    contact = models.ForeignKey(
        "Contact",
        models.DO_NOTHING,
        custom=True,
        related_name="classenrollment_contact_set",
    )  # Master Detail Relationship 0
    role = models.CharField(
        custom=True,
        max_length=255,
        choices=[("Student", "Student"), ("TA", "TA"),
                 ("Volunteer", "Volunteer")],
        blank=True,
        null=True,
    )
    class_offering = models.ForeignKey(
        "ClassOffering",
        models.DO_NOTHING,
        db_column="Class_Offering__c",
        custom=True)  # Master Detail Relationship 1
    status = models.CharField(custom=True,
                              max_length=255,
                              choices=STATUS_CHOICES,
                              blank=True,
                              null=True)
    in_current_semester = models.BooleanField(
        custom=True,
        db_column="In_current_semester__c",
        verbose_name="In current semester?",
        sf_read_only=models.READ_ONLY,
    )
    attended_family_orientation = models.BooleanField(
        custom=True,
        db_column="Attended_Family_Orientation__c",
        verbose_name="Attended Family Orientation",
        default=models.DEFAULTED_ON_CREATE,
    )
    withdrew_application_detail = models.CharField(
        custom=True,
        db_column="Withdrew_Application_Detail__c",
        max_length=255,
        verbose_name="Withdrew-Application Detail",
        help_text=
        '"Dropped in first 2 weeks" means that they showed up for class but decided to drop within the first 2 weeks.',
        choices=APP_WD_CHOICES,
        blank=True,
        null=True,
    )
    contact_race = models.CharField(
        custom=True,
        db_column="Contact_Race__c",
        max_length=100,
        verbose_name="Contact - Race",
        help_text="DO NOT EDIT - AUTO-POPULATED BY SYSTEM",
        blank=True,
        null=True,
    )
    contact_gender = models.CharField(
        custom=True,
        db_column="Contact_Gender__c",
        max_length=30,
        verbose_name="Contact - Gender",
        help_text="DO NOT EDIT - AUTO-POPULATED BY SYSTEM",
        blank=True,
        null=True,
    )
    parent_contact = models.ForeignKey(
        "Contact",
        models.DO_NOTHING,
        db_column="Parent_Contact__c",
        custom=True,
        related_name="classenrollment_parentcontact_set",
        blank=True,
        null=True,
    )
    attended_interview = models.BooleanField(
        custom=True,
        db_column="Attended_Interview__c",
        verbose_name="Attended Interview",
        default=models.DEFAULTED_ON_CREATE,
        help_text=
        "Check if the student attended the default student admissions interview event. Note: Do not check this field if the student attended a makeup interview.",
    )
    attended_makeup_interview = models.BooleanField(
        custom=True,
        db_column="Attended_Makeup_Interview__c",
        verbose_name="Attended Makeup Interview",
        default=models.DEFAULTED_ON_CREATE,
        help_text=
        "Check if the student did not attend the default interview date, but attended a makeup session.",
    )
    cultural_affiliation_or_nationality = models.CharField(
        custom=True,
        db_column="Cultural_Affiliation_or_Nationality__c",
        max_length=100,
        verbose_name="Cultural Affiliation or Nationality",
        help_text="(optional)",
        blank=True,
        null=True,
    )
    sex_at_birth = models.CharField(
        custom=True,
        db_column="Sex_at_birth__c",
        max_length=255,
        verbose_name="What was your sex at birth?",
        help_text="(Check one)",
        choices=SEX_AT_BIRTH_CHOICES,
        blank=True,
        null=True,
    )
    sexual_orientation = models.CharField(
        custom=True,
        db_column="Sexual_orientation__c",
        max_length=255,
        verbose_name="Sexual orientation or sexual identity",
        help_text=
        "How do you describe your sexual orientation or sexual identity?",
        choices=SEXUAL_ORIENTATION_CHOICES,
        blank=True,
        null=True,
    )
    other_sexual_orientation = models.CharField(
        custom=True,
        db_column="Other_sexual_orientation__c",
        max_length=30,
        verbose_name="Other sexual orientation",
        blank=True,
        null=True,
    )
    household_type = models.CharField(
        custom=True,
        db_column="Household_type__c",
        max_length=255,
        verbose_name="Which best describes your family?",
        help_text=
        "Which best describes your family? (Check one)\r\nFamily includes, but is not limited to the following—regardless of actual or perceived sexual orientation, gender identity, or marital status—a single person or a group of persons residing together.",
        choices=HOUSEHOLD_TYPE_CHOICES,
        blank=True,
        null=True,
    )
    income_certification = models.CharField(
        custom=True,
        db_column="Income_Certification__c",
        max_length=4099,
        verbose_name="Income Certification",
        help_text="**current-within 2 months",
        choices=INCOME_CERT_CHOICES,
        blank=True,
        null=True,
    )
    estimated_income = models.DecimalField(
        custom=True,
        db_column="Estimated_income__c",
        max_digits=18,
        decimal_places=2,
        verbose_name="Estimated income",
        help_text=
        "Total estimated income for next 12 months for all adult members.",
        blank=True,
        null=True,
    )
    family_size = models.CharField(
        custom=True,
        db_column="Family_size__c",
        max_length=255,
        verbose_name="Family size",
        help_text=
        "Number of persons living in your family (including yourself):",
        choices=FAMILY_SIZE_CHOICES,
        blank=True,
        null=True,
    )
    current_income_information = models.CharField(
        custom=True,
        db_column="Current_Income_Information__c",
        max_length=255,
        verbose_name="Current Income Information",
        choices=INCOME_LEVEL_CHOICES,
        blank=True,
        null=True,
    )
    if_self_certified_please_explain = models.TextField(
        custom=True,
        db_column="If_self_certified_please_explain__c",
        verbose_name="If self-certified, please explain:",
        blank=True,
        null=True,
    )
    contact_ethnicity = models.CharField(
        custom=True,
        db_column="Contact_Ethnicity__c",
        max_length=100,
        verbose_name="Contact - Ethnicity",
        help_text="DO NOT EDIT - AUTO-POPULATED BY SYSTEM",
        blank=True,
        null=True,
    )
    notes = models.TextField(custom=True, blank=True, null=True)
    interview_date = models.DateTimeField(
        custom=True,
        db_column="Interview_Date__c",
        verbose_name="Interview Date",
        help_text=
        "This is the interview date and time that the student signed up for. Empty means that the student did not sign up for an interview. Having an interview date does not mean that the student showed up for the interview, only that they RSVP'ed.",
        blank=True,
        null=True,
    )
    returner = models.BooleanField(custom=True,
                                   verbose_name="Returner?",
                                   sf_read_only=models.READ_ONLY)
    temp_returner = models.BooleanField(
        custom=True,
        db_column="Temp_Returner__c",
        verbose_name="Returner? (temp)",
        default=models.DEFAULTED_ON_CREATE,
        help_text=
        "This is a temporary field that determines if a student is a returner based on their response to this question on the application. Once we complete migrating all of our past data into Salesforce, this field will be deleted.",
    )
    origin_school = models.CharField(
        custom=True,
        db_column="Origin_School__c",
        max_length=1300,
        verbose_name="School attended by this student",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    parent_phone = models.CharField(
        custom=True,
        db_column="Parent_Phone__c",
        max_length=1300,
        verbose_name="Parent Phone",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    parent_email = models.CharField(
        custom=True,
        db_column="Parent_Email__c",
        max_length=1300,
        verbose_name="Parent Email",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )

    class Meta(models.Model.Meta):
        db_table = "Class_Enrollment__c"
        verbose_name = "Class Enrollment"
        verbose_name_plural = "Class Enrollments"
Esempio n. 17
0
class ClassOffering(models.Model):
    # owner = models.ForeignKey('Group', models.DO_NOTHING)  # Reference to tables [Group, User]
    is_deleted = models.BooleanField(verbose_name="Deleted",
                                     sf_read_only=models.READ_ONLY,
                                     default=False)
    name = models.CharField(
        max_length=80,
        verbose_name="Class Offering Name",
        default=models.DEFAULTED_ON_CREATE,
        blank=True,
        null=True,
    )
    created_date = models.DateTimeField(sf_read_only=models.READ_ONLY)
    created_by = models.ForeignKey(
        "User",
        models.DO_NOTHING,
        related_name="classoffering_createdby_set",
        sf_read_only=models.READ_ONLY,
    )
    last_modified_date = models.DateTimeField(sf_read_only=models.READ_ONLY)
    last_modified_by = models.ForeignKey(
        "User",
        models.DO_NOTHING,
        related_name="classoffering_lastmodifiedby_set",
        sf_read_only=models.READ_ONLY,
    )
    system_modstamp = models.DateTimeField(sf_read_only=models.READ_ONLY)
    last_viewed_date = models.DateTimeField(sf_read_only=models.READ_ONLY,
                                            blank=True,
                                            null=True)
    last_referenced_date = models.DateTimeField(sf_read_only=models.READ_ONLY,
                                                blank=True,
                                                null=True)
    start_date = models.DateField(
        custom=True,
        db_column="Start_Date__c",
        verbose_name="Start Date",
        blank=True,
        null=True,
    )
    end_date = models.DateField(
        custom=True,
        db_column="End_Date__c",
        verbose_name="End Date",
        blank=True,
        null=True,
    )
    description = models.TextField(custom=True, blank=True, null=True)
    location = models.ForeignKey(Account,
                                 models.DO_NOTHING,
                                 custom=True,
                                 blank=True,
                                 null=True)
    course = models.CharField(custom=True,
                              max_length=255,
                              choices=COURSE_CHOICES,
                              blank=True,
                              null=True)
    instructor = models.ForeignKey("Contact",
                                   models.DO_NOTHING,
                                   custom=True,
                                   blank=True,
                                   null=True)
    academic_semester = models.CharField(
        custom=True,
        db_column="Academic_semester__c",
        max_length=1300,
        verbose_name="Academic semester",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    meeting_days = models.CharField(
        custom=True,
        db_column="Meeting_Days__c",
        max_length=255,
        verbose_name="Meeting Days",
        choices=MEETING_DAYS_CHOICES,
        blank=True,
        null=True,
    )
    count_total_female_students = models.DecimalField(
        custom=True,
        db_column="Count_total_female_students__c",
        max_digits=18,
        decimal_places=0,
        verbose_name="Count - Total Female Students",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    count_total_latino_african_american = models.DecimalField(
        custom=True,
        db_column="Count_total_latino_african_american__c",
        max_digits=18,
        decimal_places=0,
        verbose_name="Count - Total African American",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    count_total_latino_students = models.DecimalField(
        custom=True,
        db_column="Count_Total_Latino_Students__c",
        max_digits=18,
        decimal_places=0,
        verbose_name="Count - Total Latino Students",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    female = models.DecimalField(
        custom=True,
        max_digits=18,
        decimal_places=1,
        verbose_name="% Female",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    latino_african_american = models.DecimalField(
        custom=True,
        db_column="Latino_African_American__c",
        max_digits=18,
        decimal_places=1,
        verbose_name="% Latino/African American",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    current_academic_semester = models.CharField(
        custom=True,
        db_column="Current_academic_semester__c",
        max_length=1300,
        verbose_name="Current academic semester",
        sf_read_only=models.READ_ONLY,
        blank=True,
        null=True,
    )
    in_current_semester = models.BooleanField(
        custom=True,
        db_column="In_current_semester__c",
        verbose_name="In current semester?",
        sf_read_only=models.READ_ONLY,
    )

    class Meta(models.Model.Meta):
        db_table = "Class_Offering__c"
        verbose_name = "Class Offering"
        verbose_name_plural = "Class Offerings"
        # keyPrefix = 'a0h'

    def __str__(self):
        return "%s" % self.name