البته راه دوم و بهترش اینه :)
kwargs= {}
result_test = Reception.objects.all()
if From_Date_Response != '' and Until_Date_Response != '':
kwargs['answering_date__range'] = (From_Date_Response , Until_Date_Response )
if From_Date_Reception != '' and Until_Date_Reception != '' :
if str_1 != '' :
kwargs['date_acceptance__range'] = (From_Date_Reception , Until_Date_Reception)
else :
kwargs['date_acceptance__range'] = (From_Date_Reception , Until_Date_Reception)
if From_Number_Reception != '' and Until_Number_Reception != '' :
if str_1 != '' :
kwargs['id_reception__range'] = (int(From_Number_Reception) , int (Until_Number_Reception))
else :
kwargs['id_reception__range'] = (int(From_Number_Reception) , int (Until_Number_Reception))
result_test = Reception.objects.filter(**kwargs)