我想在模板中显示女子联赛,这是我的views.py代码:
leagues = League.objects.all()
for league in leagues:
print(league.name)
它将向我显示所有联赛的名称:
International Conference of Amateur Ice Hockey
International Collegiate Baseball Conference
Atlantic Federation of Amateur Baseball Players
Atlantic Federation of Basketball Athletics
Atlantic Soccer Conference
International Association of Womens' Basketball Players
American Conference of Amateur Football
Atlantic Amateur Field Hockey League
Transamerican Womens' Football Athletics Conference
Pacific Ice Hockey Conference
我如何循环遍历这些名称并挑选出包含女子联赛的联赛?
达令说
冉冉说
相关分类