MCPcopy
hub / github.com/tortoise/tortoise-orm / exclude

Method exclude

tortoise/models.py:1531–1538  ·  view source on GitHub ↗

Generates a QuerySet with the exclude applied. :param args: Q functions containing constraints. Will be AND'ed. :param kwargs: Simple filter constraints.

(cls, *args: Q, **kwargs: Any)

Source from the content-addressed store, hash-verified

1529
1530 @classmethod
1531 def exclude(cls, *args: Q, **kwargs: Any) -> QuerySet[Self]:
1532 """
1533 Generates a QuerySet with the exclude applied.
1534
1535 :param args: Q functions containing constraints. Will be AND'ed.
1536 :param kwargs: Simple filter constraints.
1537 """
1538 return cls._meta.manager.get_queryset().exclude(*args, **kwargs)
1539
1540 @classmethod
1541 def annotate(cls, **kwargs: Expression | Term) -> QuerySet[Self]:

Callers 6

test_excludeFunction · 0.45
test_exclude_with_filterFunction · 0.45
test_filtersFunction · 0.45
test_joinsFunction · 0.45
test_where_and_havingFunction · 0.45

Calls 1

get_querysetMethod · 0.45

Tested by 6

test_excludeFunction · 0.36
test_exclude_with_filterFunction · 0.36
test_filtersFunction · 0.36
test_joinsFunction · 0.36
test_where_and_havingFunction · 0.36