I`ve been searching and trying to get this to work for the past few hours and I cant ...
I have a list of skills that I take from the database
forms.ModelMultipleChoiceField(
skills.objects.all(),
required=True,
widget=forms.CheckboxSelectMultiple(),
label='Check your skills.',
initial=skill_list.objects.filter(user='void'),
)
but this aint working as I expect it to work I basically wanna display the list of skills (all of them) and the ones that the user has checked to be checked ... pff I cant even explain right...
after the user checks the checkbox and hits submit in another page I wanna display all skills and the one the user checked to be checked ...
Lets say I have a b c and the user checks b and hits submit when in w/e page I wanna display a uncheked b checked c unchecked ...
Can some one help me with this ? Thx.
PS: if i use skills.objects.all() I get in the html value 1 and a how can I make this as
skills = (
('a', 'a'),
('b', 'b'),
)
instead of ('1', 'a'), ('2', 'b')
Thx a lot.