Filter

Base class: Part

Class that describes a filter that you can search for.

See Query for more complete examples.

Parameters with the prefix field__ will be passed along downstream to the Field instance if applicable. This can be used to tweak the basic style interface.

Refinable members

  • after
  • attr
  • choices
  • endpoints
    Type: Namespace
  • extra
  • extra_evaluated
  • field
    Type: Namespace
  • freetext
  • include
    Type: bool
  • iommi_style
    Type: str
  • model
  • model_field
  • model_field_name
  • parse
  • query_operator_for_field
    Type: str
  • query_operator_to_q_operator
  • search_fields
  • unary
  • value_to_q

Defaults

  • field__include
    • lambda query, field, **_: not query.filters.get(field._name).freetext
  • field__required
    • False
  • query_operator_for_field
    • =

Shortcuts

boolean

Defaults

  • field__call_target__attribute
    • boolean
  • parse
    • iommi.form.bool_parse
  • unary
    • True

boolean_tristate

Defaults

  • field__call_target__attribute
    • boolean_tristate
  • parse
    • iommi.form.boolean_tristate__parse
  • unary
    • True

case_sensitive

Defaults

  • query_operator_to_q_operator
    • iommi.query.case_sensitive_query_operator_to_q_operator

choice

Field that has one value out of a set.
type choices:list

Defaults

  • field__call_target__attribute
    • choice

choice_queryset

Field that has one value out of a set.

Defaults

  • field__call_target__attribute
    • choice_queryset
  • query_operator_to_q_operator
    • lambda op: 'exact'
  • value_to_q
    • iommi.query.choice_queryset_value_to_q

date

Defaults

  • field__call_target__attribute
    • date
  • parse
    • iommi.form.date_parse

datetime

Defaults

  • field__call_target__attribute
    • datetime
  • parse
    • iommi.form.datetime_parse

decimal

Defaults

  • field__call_target__attribute
    • decimal

email

Defaults

  • field__call_target__attribute
    • email

file

Defaults

  • field__call_target__attribute
    • file

float

Defaults

  • field__call_target__attribute
    • float
  • parse
    • iommi.form.float_parse

foreign_key

Defaults

  • call_target__attribute
    • choice_queryset
  • field__call_target__attribute
    • foreign_key

integer

Defaults

  • field__call_target__attribute
    • integer
  • parse
    • iommi.form.int_parse

many_to_many

Defaults

  • call_target__attribute
    • multi_choice_queryset
  • field__call_target__attribute
    • many_to_many

multi_choice

Field that has one value out of a set.
type choices:list

Defaults

  • field__call_target__attribute
    • multi_choice

multi_choice_queryset

Defaults

  • call_target__attribute
    • choice_queryset
  • field__call_target__attribute
    • multi_choice_queryset

text

Defaults

  • field__call_target__attribute
    • text
  • query_operator_for_field
    • :

time

Defaults

  • field__call_target__attribute
    • time
  • parse
    • iommi.form.time_parse

url

Defaults

  • field__call_target__attribute
    • url