Django ModelForm overriding __init__

后端 未结 2 2012
小蘑菇
小蘑菇 2021-01-05 18:15

I\'m trying to populate a Select list of a ModelForm, with the Django groups the current users belongs to.

No errors arise, but I get only an empty Select list.

2条回答
  •  滥情空心
    2021-01-05 18:29

    That last line is overwriting the queryset assigned in previous one. Remove it.

提交回复
热议问题