Skip to content
Snippets Groups Projects
Select Git revision
  • 68c6b41fa097340815f28b5f27cc52d0bb99b455
  • master default protected
  • feat/new-image-formats
  • clickable-select-chevron
  • 2.20.0
  • 2.19.0
  • 2.18.0
  • 2.17.0
  • 2.16.1
  • 2.16.0
  • 2.15.0
  • 2.14.0
  • 2.13.0
  • 2.12.1
  • 2.11.0
  • 2.10.0
  • 2.9.1
  • 2.9.0
  • 2.8.0
  • 2.7.1
  • 2.7.0
  • 2.6.0
  • 2.5.2
  • 2.5.1
24 results

badge.pcss

Blame
  • utils.py 700 B
    from .constants import (
        AGE_18_29,
        AGE_30_49,
        AGE_50_64,
        AGE_65_PLUS,
        CHILDLESS,
        MATURE,
        OCCUPATION_STUDENT,
        OCCUPATION_WORKING,
        PARENTS,
        SENIORS,
        STUDENTS,
        WORKING_SENIORS,
    )
    
    
    def get_archetype(selection):
        if selection["occupation"] == OCCUPATION_STUDENT:
            return STUDENTS
        if selection["age"] == AGE_50_64:
            return MATURE
        if selection["age"] == AGE_65_PLUS:
            if selection["occupation"] == OCCUPATION_WORKING:
                return WORKING_SENIORS
            return SENIORS
        if selection["age"] in [AGE_18_29, AGE_30_49]:
            if selection["kids"]:
                return PARENTS
            return CHILDLESS
        return None