我想在模板中顯示女子聯賽,這是我的views.py代碼:leagues = League.objects.all()for league in leagues: print(league.name)它將向我顯示所有聯賽的名稱:International Conference of Amateur Ice HockeyInternational Collegiate Baseball ConferenceAtlantic Federation of Amateur Baseball PlayersAtlantic Federation of Basketball AthleticsAtlantic Soccer ConferenceInternational Association of Womens' Basketball PlayersAmerican Conference of Amateur FootballAtlantic Amateur Field Hockey LeagueTransamerican Womens' Football Athletics ConferencePacific Ice Hockey Conference我如何循環遍歷這些名稱并挑選出包含女子聯賽的聯賽?
如何在 Python 模型中循環遍歷字符串?
慕碼人8056858
2024-01-11 17:38:43