Skip to content

queryset.field_accessor

FieldAccessor Objects

1
class FieldAccessor()

Helper to access ormar fields directly from Model class also for nested models attributes.

__bool__

1
 | __bool__() -> bool

Hack to avoid pydantic name check from parent model, returns false

Returns:

False :rtype: bool

__getattr__

1
 | __getattr__(item: str) -> Any

Accessor return new accessor for each field and nested models. Thanks to that operator overload is possible to use in filter.

Arguments:

  • item: attribute name :type item: str

Returns:

FieldAccessor for field or nested model :rtype: ormar.queryset.field_accessor.FieldAccessor

__eq__

1
 | __eq__(other: Any) -> FilterGroup

overloaded to work as sql column = <VALUE>

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

__ge__

1
 | __ge__(other: Any) -> FilterGroup

overloaded to work as sql column >= <VALUE>

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

__gt__

1
 | __gt__(other: Any) -> FilterGroup

overloaded to work as sql column > <VALUE>

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

__le__

1
 | __le__(other: Any) -> FilterGroup

overloaded to work as sql column <= <VALUE>

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

__lt__

1
 | __lt__(other: Any) -> FilterGroup

overloaded to work as sql column < <VALUE>

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

__mod__

1
 | __mod__(other: Any) -> FilterGroup

overloaded to work as sql column LIKE '%<VALUE>%'

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

__lshift__

1
 | __lshift__(other: Any) -> FilterGroup

overloaded to work as sql column IN (<VALUE1>, <VALUE2>,...)

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

__rshift__

1
 | __rshift__(other: Any) -> FilterGroup

overloaded to work as sql column IS NULL

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

in_

1
 | in_(other: Any) -> FilterGroup

works as sql column IN (<VALUE1>, <VALUE2>,...)

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

iexact

1
 | iexact(other: Any) -> FilterGroup

works as sql column = <VALUE> case-insensitive

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

contains

1
 | contains(other: Any) -> FilterGroup

works as sql column LIKE '%<VALUE>%'

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

icontains

1
 | icontains(other: Any) -> FilterGroup

works as sql column LIKE '%<VALUE>%' case-insensitive

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

startswith

1
 | startswith(other: Any) -> FilterGroup

works as sql column LIKE '<VALUE>%'

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

istartswith

1
 | istartswith(other: Any) -> FilterGroup

works as sql column LIKE '%<VALUE>' case-insensitive

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

endswith

1
 | endswith(other: Any) -> FilterGroup

works as sql column LIKE '%<VALUE>'

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

iendswith

1
 | iendswith(other: Any) -> FilterGroup

works as sql column LIKE '%<VALUE>' case-insensitive

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

isnull

1
 | isnull(other: Any) -> FilterGroup

works as sql column IS NULL or IS NOT NULL

Arguments:

  • other: value to check agains operator :type other: str

Returns:

FilterGroup for operator :rtype: ormar.queryset.clause.FilterGroup

asc

1
 | asc() -> OrderAction

works as sql column asc

Returns:

OrderGroup for operator :rtype: ormar.queryset.actions.OrderGroup

desc

1
 | desc() -> OrderAction

works as sql column desc

Returns:

OrderGroup for operator :rtype: ormar.queryset.actions.OrderGroup