How to use the intake.fields.CharField function in intake

To help you get started, we’ve selected a few intake examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github codeforamerica / intake / intake / serializer_forms.py View on Github external
us_citizen = fields.IsUSCitizenField(required=False)

    currently_employed = fields.IsCurrentlyEmployedField(required=False)
    monthly_income = fields.MonthlyIncomeField(required=False)
    monthly_expenses = fields.MonthlyExpensesField(required=False)
    on_probation_parole = fields.YesNoBlankField(
        label=_("Are you on probation or parole?"))
    where_probation_or_parole = fields.CharField(
        label=_("Where is your probation or parole?"),
        required=False)
    when_probation_or_parole = fields.CharField(
        label=_("When does your probation or parole end?"),
        required=False)
    rap_outside_sf = fields.YesNoBlankField(
        label=_("Have you ever been arrested or convicted outside of San Francisco?"))
    when_where_outside_sf = fields.CharField(
        label=_("When and where were you arrested or convicted outside of San Francisco?"),
        required=False)

    def validate_ssn(self, ssn):
        if not ssn.strip():
            self.add_warning('ssn', Warnings.SSN)
        return ssn

    def validate_address(self, address):
        if not address:
            self.add_warning('address', Warnings.ADDRESS)
        return address

    def validate_dob(self, dob):
        if not dob:
            self.add_warning('dob', Warnings.DOB)
github codeforamerica / intake / intake / serializer_forms.py View on Github external
help_text=_('For example "yourname@example.com"'),
        required=False)
    address = fields.AddressMultiValueFormField()

    us_citizen = fields.IsUSCitizenField()
    serving_sentence = fields.YesNoBlankField(
        label=_("Are you currently serving a sentence?"))
    being_charged = fields.YesNoBlankField(
        label=_("Are you currently being charged with a crime?"))

    financial_screening_note = _("The Clean Slate program is free for you, but the public defender uses this information to get money from government programs.")
    currently_employed = fields.IsCurrentlyEmployedField()
    monthly_income = fields.MonthlyIncomeField()
    monthly_expenses = fields.MonthlyExpensesField()

    how_did_you_hear = fields.CharField(
        label=_("How did you hear about this program or website?"),
        required=False)

    class Meta:
        validators = [
            validators.gave_preferred_contact_methods
        ]


class ContraCostaCleanSlateForm(CleanSlateCommonForm):
    """A form for applying to Contra Costa County Public Defender's
        Clean Slate program
        inherits fields from CleanSlateCommonForm
    """

    on_probation = fields.YesNoField(
github codeforamerica / intake / intake / serializer_forms.py View on Github external
as well as common criteria
    """
    contact_preferences = fields.MultipleChoiceField(
        label=_('How would you like us to contact you?'),
        help_text=_(
            'Code for America will use this to update you about your application.'),
        choices=CONTACT_PREFERENCE_CHOICES,
        required=False
        )

    first_name = fields.CharField(
        label=_('What is your first name?'))
    middle_name = fields.CharField(
        label=_('What is your middle name?'),
        required=False)
    last_name = fields.CharField(
        label=_('What is your last name?'))
    dob = fields.DateOfBirthMultiValueFormField()

    phone_number = fields.CharField(
        label=_('What is your phone number?'),
        help_text=_('Code for America and the public defender will use this to contact you about your application.'),
        required=False)
    email = fields.EmailField(
        label=_('What is your email?'),
        help_text=_('For example "yourname@example.com"'),
        required=False)
    address = fields.AddressMultiValueFormField()

    us_citizen = fields.IsUSCitizenField()
    serving_sentence = fields.YesNoBlankField(
        label=_("Are you currently serving a sentence?"))
github codeforamerica / intake / intake / serializer_forms.py View on Github external
address = fields.AddressMultiValueFormField(required=False)
    ssn = fields.CharField(
        label=_('What is your Social Security Number?'),
        help_text=_("The public defender's office will use this to get your San Francisco RAP sheet and find any convictions that can be reduced or dismissed."),
        required=False)
    dob = fields.DateOfBirthMultiValueFormField(required=False)

    us_citizen = fields.IsUSCitizenField(required=False)

    currently_employed = fields.IsCurrentlyEmployedField(required=False)
    monthly_income = fields.MonthlyIncomeField(required=False)
    monthly_expenses = fields.MonthlyExpensesField(required=False)
    on_probation_parole = fields.YesNoBlankField(
        label=_("Are you on probation or parole?"))
    where_probation_or_parole = fields.CharField(
        label=_("Where is your probation or parole?"),
        required=False)
    when_probation_or_parole = fields.CharField(
        label=_("When does your probation or parole end?"),
        required=False)
    rap_outside_sf = fields.YesNoBlankField(
        label=_("Have you ever been arrested or convicted outside of San Francisco?"))
    when_where_outside_sf = fields.CharField(
        label=_("When and where were you arrested or convicted outside of San Francisco?"),
        required=False)

    def validate_ssn(self, ssn):
        if not ssn.strip():
            self.add_warning('ssn', Warnings.SSN)
        return ssn
github codeforamerica / intake / intake / serializer_forms.py View on Github external
class CleanSlateCommonForm(Form):
    """A form with fields common across Clean Slate County forms
        Includes fields for contact information and basic identifying information,
        as well as common criteria
    """
    contact_preferences = fields.MultipleChoiceField(
        label=_('How would you like us to contact you?'),
        help_text=_(
            'Code for America will use this to update you about your application.'),
        choices=CONTACT_PREFERENCE_CHOICES,
        required=False
        )

    first_name = fields.CharField(
        label=_('What is your first name?'))
    middle_name = fields.CharField(
        label=_('What is your middle name?'),
        required=False)
    last_name = fields.CharField(
        label=_('What is your last name?'))
    dob = fields.DateOfBirthMultiValueFormField()

    phone_number = fields.CharField(
        label=_('What is your phone number?'),
        help_text=_('Code for America and the public defender will use this to contact you about your application.'),
        required=False)
    email = fields.EmailField(
        label=_('What is your email?'),
        help_text=_('For example "yourname@example.com"'),
        required=False)
    address = fields.AddressMultiValueFormField()
github codeforamerica / intake / intake / serializer_forms.py View on Github external
on_probation = fields.YesNoField(
        label=_("Are you on probation?"))
    on_parole = fields.YesNoField(
        label=_("Are you on parole?"))

    income_source = fields.CharField(
        label=_("Where does your income come from?"),
        help_text=_("For example: Job, Social Security, Food stamps"))


class ClearMyRecordSFForm(CleanSlateCommonForm):
    """A form for applying to SF Public Defender's Clean Slate program
    """

    address = fields.AddressMultiValueFormField(required=False)
    ssn = fields.CharField(
        label=_('What is your Social Security Number?'),
        help_text=_("The public defender's office will use this to get your San Francisco RAP sheet and find any convictions that can be reduced or dismissed."),
        required=False)
    dob = fields.DateOfBirthMultiValueFormField(required=False)

    us_citizen = fields.IsUSCitizenField(required=False)

    currently_employed = fields.IsCurrentlyEmployedField(required=False)
    monthly_income = fields.MonthlyIncomeField(required=False)
    monthly_expenses = fields.MonthlyExpensesField(required=False)
    on_probation_parole = fields.YesNoBlankField(
        label=_("Are you on probation or parole?"))
    where_probation_or_parole = fields.CharField(
        label=_("Where is your probation or parole?"),
        required=False)
    when_probation_or_parole = fields.CharField(
github codeforamerica / intake / intake / serializer_forms.py View on Github external
label=_('What is your Social Security Number?'),
        help_text=_("The public defender's office will use this to get your San Francisco RAP sheet and find any convictions that can be reduced or dismissed."),
        required=False)
    dob = fields.DateOfBirthMultiValueFormField(required=False)

    us_citizen = fields.IsUSCitizenField(required=False)

    currently_employed = fields.IsCurrentlyEmployedField(required=False)
    monthly_income = fields.MonthlyIncomeField(required=False)
    monthly_expenses = fields.MonthlyExpensesField(required=False)
    on_probation_parole = fields.YesNoBlankField(
        label=_("Are you on probation or parole?"))
    where_probation_or_parole = fields.CharField(
        label=_("Where is your probation or parole?"),
        required=False)
    when_probation_or_parole = fields.CharField(
        label=_("When does your probation or parole end?"),
        required=False)
    rap_outside_sf = fields.YesNoBlankField(
        label=_("Have you ever been arrested or convicted outside of San Francisco?"))
    when_where_outside_sf = fields.CharField(
        label=_("When and where were you arrested or convicted outside of San Francisco?"),
        required=False)

    def validate_ssn(self, ssn):
        if not ssn.strip():
            self.add_warning('ssn', Warnings.SSN)
        return ssn

    def validate_address(self, address):
        if not address:
            self.add_warning('address', Warnings.ADDRESS)
github codeforamerica / intake / intake / serializer_forms.py View on Github external
class CleanSlateCommonForm(Form):
    """A form with fields common across Clean Slate County forms
        Includes fields for contact information and basic identifying information,
        as well as common criteria
    """
    contact_preferences = fields.MultipleChoiceField(
        label=_('How would you like us to contact you?'),
        help_text=_(
            'Code for America will use this to update you about your application.'),
        choices=CONTACT_PREFERENCE_CHOICES,
        required=False
        )

    first_name = fields.CharField(
        label=_('What is your first name?'))
    middle_name = fields.CharField(
        label=_('What is your middle name?'),
        required=False)
    last_name = fields.CharField(
        label=_('What is your last name?'))
    dob = fields.DateOfBirthMultiValueFormField()

    phone_number = fields.CharField(
        label=_('What is your phone number?'),
        help_text=_('Code for America and the public defender will use this to contact you about your application.'),
        required=False)
    email = fields.EmailField(
        label=_('What is your email?'),
        help_text=_('For example "yourname@example.com"'),
        required=False)
github codeforamerica / intake / intake / fields.py View on Github external
street = CharField(required=False)
    city = CharField(label=_("City"), required=False)
    state = CharField(label=_("State"), required=False)
    zip = CharField(label=_("Zip"), required=False)

    def build_instance(self, **kwargs):
        return Address(**kwargs)


class DateOfBirthMultiValueFormField(MultiValueFormField):
    label = _("What is your date of birth?")
    help_text = _("For example: 4/28/1986")

    month = CharField(label=_("Month"), required=False)
    day = CharField(label=_("Day"), required=False)
    year = CharField(label=_("Year"), required=False)

    def build_instance(self, **kwargs):
        return DateOfBirth(**kwargs)


class BayAreaCountiesField(MultipleChoiceField):
    choices = COUNTY_CHOICES
    label = _("Which counties were you arrested in?")
github codeforamerica / intake / intake / fields.py View on Github external
return vars(obj)

    def get_value(self, dictionary):
        value = super().get_value(dictionary)
        if value == rest_framework.fields.empty:
            return {}
        return value


class AddressMultiValueFormField(MultiValueFormField):
    label = _("What is your mailing address?")
    help_text = _("The public defender will need to send you important papers.")

    street = CharField(required=False)
    city = CharField(label=_("City"), required=False)
    state = CharField(label=_("State"), required=False)
    zip = CharField(label=_("Zip"), required=False)

    def build_instance(self, **kwargs):
        return Address(**kwargs)


class DateOfBirthMultiValueFormField(MultiValueFormField):
    label = _("What is your date of birth?")
    help_text = _("For example: 4/28/1986")

    month = CharField(label=_("Month"), required=False)
    day = CharField(label=_("Day"), required=False)
    year = CharField(label=_("Year"), required=False)

    def build_instance(self, **kwargs):
        return DateOfBirth(**kwargs)