Skip to content

Commit

Permalink
style: run ruff auto fix
Browse files Browse the repository at this point in the history
  • Loading branch information
joaodaher committed Dec 9, 2024
1 parent 2ad2a6d commit bd0df8a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions drf_kit/managers/soft_delete_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def filter(self, *args, **kwargs):
qs = qs.distinct()
return qs

def _get_m2m_relations_for(self, fields: Iterable[str]) -> Generator["SoftDeleteModel", None, None]: # noqa: F821
def _get_m2m_relations_for(self, fields: Iterable[str]) -> Generator["SoftDeleteModel"]: # noqa: F821
from drf_kit.models import SoftDeleteModel

related_fields = {field.split("__")[0] for field in fields}
Expand All @@ -78,7 +78,7 @@ def _get_m2m_with_soft_delete(
if rel_model := _get_m2m_with_soft_delete(field_name=field_obj.name, m2m_rel=rel_obj):
yield rel_model

def _get_extra_filters(self, fields: Iterable[str]) -> Generator[dict[str, bool], None, None]:
def _get_extra_filters(self, fields: Iterable[str]) -> Generator[dict[str, bool]]:
for rel_model in self._get_m2m_relations_for(fields=fields):
field_name = None
for field in rel_model._meta.get_fields():
Expand Down
18 changes: 9 additions & 9 deletions drf_kit/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ class Meta(OrderedModelMixin.Meta, InheritanceModelMixin.Meta, BaseModel.Meta):


__all__ = (
"ModelDiffMixin",
"BoundedFileMixin",
"AvailabilityModel",
"AvailabilityModelMixin",
"BaseModel",
"SoftDeleteModel",
"OrderedModel",
"BoundedFileMixin",
"InheritanceModel",
"SoftDeleteInheritanceOrderedModel",
"InheritanceOrderedModel",
"ModelDiffMixin",
"OrderedModel",
"SoftDeleteAvailabilityModel",
"SoftDeleteInheritanceModel",
"SoftDeleteInheritanceOrderedModel",
"SoftDeleteModel",
"SoftDeleteOrderedModel",
"SoftDeleteAvailabilityModel",
"InheritanceOrderedModel",
"AvailabilityModel",
"AvailabilityModelMixin",
)
28 changes: 14 additions & 14 deletions drf_kit/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@
)

__all__ = (
"NestedModelViewSet",
"CachedModelViewSet",
"CachedNestedModelViewSet",
"ReadOnlyNestedModelViewSet",
"CachedReadOnlyNestedModelViewSet",
"NonDestructiveModelViewSet",
"CachedNonDestructiveModelViewSet",
"WriteOnlyNestedModelViewSet",
"SingleNestedModelViewSet",
"CachedSingleNestedModelViewSet",
"ReadOnlySingleNestedModelViewSet",
"CachedReadOnlyModelViewSet",
"CachedReadOnlyNestedModelViewSet",
"CachedReadOnlySingleNestedModelViewSet",
"CachedSearchableMixin",
"CachedSearchableModelViewSet",
"CachedSearchableNestedModelViewSet",
"CachedSearchableNonDestructiveModelViewSet",
"CachedSearchableReadOnlyModelViewSet",
"CachedSearchableReadOnlyNestedModelViewSet",
"CachedSingleNestedModelViewSet",
"ModelViewSet",
"CachedModelViewSet",
"NestedModelViewSet",
"NonDestructiveModelViewSet",
"ReadOnlyModelViewSet",
"CachedReadOnlyModelViewSet",
"WriteOnlyModelViewSet",
"UpsertMixin",
"ReadOnlyNestedModelViewSet",
"ReadOnlySingleNestedModelViewSet",
"SingleNestedModelViewSet",
"StatsViewMixin",
"CachedSearchableNestedModelViewSet",
"CachedSearchableReadOnlyNestedModelViewSet",
"UpsertMixin",
"WriteOnlyModelViewSet",
"WriteOnlyNestedModelViewSet",
)

0 comments on commit bd0df8a

Please sign in to comment.