工作中用到的,存照一下。
from django.db.models import Q if self.kwargs.has_key('search_pk'): search_pk = self.kwargs['search_pk'] return SubServer.objects.filter(Q(name__icontains=search_pk)|Q(app_name__name__icontains=search_pk))
2023-11-24 08:15:34
工作中用到的,存照一下。
from django.db.models import Q if self.kwargs.has_key('search_pk'): search_pk = self.kwargs['search_pk'] return SubServer.objects.filter(Q(name__icontains=search_pk)|Q(app_name__name__icontains=search_pk))
下一篇:NYOJ之括号配对问题