mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
558 B
19 lines
558 B
3 years ago
|
from django_filters import rest_framework as filters
|
||
|
from common.drf.filters import BaseFilterSet
|
||
|
|
||
|
from tickets.models import Ticket
|
||
|
|
||
|
|
||
|
class TicketFilter(BaseFilterSet):
|
||
|
assignees__id = filters.UUIDFilter(method='filter_assignees_id')
|
||
|
|
||
|
class Meta:
|
||
|
model = Ticket
|
||
|
fields = (
|
||
|
'id', 'title', 'type', 'status', 'applicant', 'assignees__id',
|
||
|
'applicant_display',
|
||
|
)
|
||
|
|
||
|
def filter_assignees_id(self, queryset, name, value):
|
||
|
return queryset.filter(ticket_steps__ticket_assignees__assignee__id=value)
|