How to use the intake.models.County.objects.filter 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 / models / form_submission.py View on Github external
def get_counties(self):
        return intake.models.County.objects.filter(
            organizations__submissions=self).distinct()
github codeforamerica / intake / intake / services / counties.py View on Github external
def get_live_counties_and_orgs():
    live_orgs = Organization.objects.filter(
        is_live=True, is_receiving_agency=True)
    live_counties = County.objects.filter(
        organizations__in=live_orgs).distinct()
    return live_counties, live_orgs
github codeforamerica / intake / intake / models.py View on Github external
def get_counties(self):
        return County.objects.filter(
            organizations__submissions=self).distinct()
github codeforamerica / intake / intake / views / session_view_base.py View on Github external
def get_counties(self):
        session_data = self.get_session_data()
        county_slugs = session_data.get('counties', [])
        return models.County.objects.filter(slug__in=county_slugs).all()
github codeforamerica / intake / features / steps / county_applications_steps.py View on Github external
def get_counties_from_county_names_string(county_names_string):
    """converts an oxford comma string of county names in to
        county model instances
    """
    return models.County.objects.filter(
        name__in=oxford_comma_text_to_list(county_names_string))
github codeforamerica / intake / intake / views / session_view_base.py View on Github external
def get_context_data(self, *args, **kwargs):
        context = super().get_context_data(*args, **kwargs)
        county_slugs = self.session_data.get('counties', [])
        counties = models.County.objects.filter(slug__in=county_slugs).all()
        context.update(
            counties=counties,
            county_list=[county.name + " County" for county in counties])
        return context