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
  • field_name
  • freetext
  • include
    Type: bool
  • iommi_style
    Type: str
  • model
  • model_field
  • name_field
  • query_operator_for_field
    Type: str
  • query_operator_to_q_operator
  • 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
  • value_to_q
    • iommi.query.boolean_value_to_q
  • unary
    • True

boolean_tristate

Defaults

  • field__call_target__attribute
    • boolean_tristate
  • value_to_q
    • iommi.query.boolean_value_to_q
  • 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

datetime

Defaults

  • field__call_target__attribute
    • datetime

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

foreign_key

Defaults

  • call_target__attribute
    • choice_queryset
  • field__call_target__attribute
    • foreign_key

integer

Defaults

  • field__call_target__attribute
    • integer

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

time

Defaults

  • field__call_target__attribute
    • time

url

Defaults

  • field__call_target__attribute
    • url