17 lines
420 B
Python
17 lines
420 B
Python
"""Establishment app views."""
|
|
|
|
from rest_framework import permissions
|
|
|
|
from establishment import models
|
|
|
|
|
|
class EstablishmentMixin:
|
|
"""Establishment mixin."""
|
|
|
|
permission_classes = (permissions.AllowAny,)
|
|
|
|
def get_queryset(self):
|
|
"""Overrided method 'get_queryset'."""
|
|
return models.Establishment.objects.published() \
|
|
.prefetch_actual_employees()
|