How to write query user between dates no leaves?

11 views
Skip to first unread message

Prashanth Patelc

unread,
Feb 24, 2023, 9:10:16 AM2/24/23
to django...@googlegroups.com
How to write orm query? 

User don't have any leave between two dates in django ?

leave_data = EmployeeLeaves.objects.filter(~Q(approval_status='Approved'),~Q(approval_status='Cancelled'),~Q(approval_status='Rejected'),
                                                   from_date__gte=month_first_date, to_date__lte=month_last_day,
                                                   employee=request.user)
Reply all
Reply to author
Forward
0 new messages