Skip to content

Instantly share code, notes, and snippets.

@tonytan4ever
Created November 7, 2019 04:37
Show Gist options
  • Save tonytan4ever/b459765b6cbf29f7fad26b9aba3829a1 to your computer and use it in GitHub Desktop.
Save tonytan4ever/b459765b6cbf29f7fad26b9aba3829a1 to your computer and use it in GitHub Desktop.
if badge_number is not None:
queryset = queryset.filter(badge_display_id__startswith = badge_number)
if employee_number is not None:
payroll_worker_ids = WorkerPayrollCode.objects.filter(code__startswith = employee_number).values_list('worker_id', flat=True)
queryset = queryset.filter(id__in=payroll_worker_ids)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment