def get_conditions(filters):
    conditions = ''
    if filters.get('from_date'):
        conditions += ' attendance_date >= %(from_date)s'
    if filters.get('to_date'):
        conditions += ' and attendance_date <= %(to_date)s'
    if filters.get('company'):
        conditions += ' and company = %(company)s'
    if filters.get('employee'):
        conditions += ' and employee = %(employee)s'
    if filters.get('department'):
        conditions += ' and department = %(department)s'
    return (conditions, filters)
def get_conditions(filters):
    conditions = 
    if filters.get('from_date'):
        conditions += ' attendance_date >= %(from_date)s'
    if filters.get('to_date'):
        conditions += ' and attendance_date <= %(to_date)s'
    if filters.get('company'):
        conditions += ' and company = %(company)s'
    if filters.get('employee'):
        conditions += ' and employee = %(employee)s'
    if filters.get('department'):
        conditions += ' and department = %(department)s'
    return (conditions, filters)