質問編集履歴
1
一部記載ミスにより編集しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -58,19 +58,17 @@
|
|
58
58
|
|
59
59
|
|
60
60
|
|
61
|
-
#Groupの
|
61
|
+
#Groupの選択メニューフォーム作成
|
62
62
|
|
63
|
-
class Group
|
63
|
+
class GroupSelectForm(forms.Form):
|
64
64
|
|
65
|
-
def __int__(self, user, *args, **kwargs):
|
65
|
+
def __init__(self, user, *args, **kwargs):
|
66
66
|
|
67
|
-
|
67
|
+
super(GroupSelectForm, self).__init__(*args, **kwargs)
|
68
68
|
|
69
|
-
self.fields["groups"] = forms.
|
69
|
+
self.fields["groups"] = forms.ChoiceField(
|
70
70
|
|
71
|
-
choices = [(item.title, item.title) for item in Group.objects.filter(owner
|
71
|
+
choices = [("-", "-")] + [(item.title, item.title) for item in Group.objects.filter(owner = user)],
|
72
|
-
|
73
|
-
widget = forms.CheckboxSelectMultiple(),
|
74
72
|
|
75
73
|
)
|
76
74
|
|