Show Data of Customer and License from database according to the click on dropdown list of financial year
dropdown financial year show data from database as per the financial year in all pages
enter image description here dropdown that i created
def get_financial_year(date):
year = date.year
if date.month < 4: # before April, in the previous financial year
year -= 1
return f'{year}-{year + 1}'
financial_years = {}
for license in licenses:
financial_year = get_financial_year(license.Subscription_End_Date)
if financial_year not in financial_years:
financial_years[financial_year] = 0
financial_years[financial_year] += 1
print(financial_years.keys())
financial_years_list = sorted(financial_years)
how show data