PERSON_ACTIONS = (
    ('1', '01.Allowed to rest and returned to class'),
    ('2', '02.Contacted parents /guardians'),
    ('3', '02a.- Unable to Contact'),
    ('4', '02b.Unavailable - left message'),)
class PersonActionsForm(forms.ModelForm):

    action = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple(), 
choices=PERSON_ACTIONS, required=False, label= u"Actions")

models.py
class Actions(models.Model): reportperson = 
models.ForeignKey(ReportPerson)action 
= models.IntegerField('Action type') 

views.py
def actions(request): 
    '''''' 
    action= Actions.objects.filter(reportperson=person_id) 
    action_checked_list = action.values_list('action',flat=True) 
    actionform = PersonActionsForm(initial={'action': action_checked_list}) 
    '''''''' 
    return render_to_response('action.html', { 'actionform':actionform, 
},context_instance
=RequestContext(request))

I am keeping the forms choices in PersonActionsForm,and saving the choice 
values in database as 1,2,3 and 4.

In views.py,i queried the entire row and taken the entire form for 
display.So now the checked choices and unchecked choices are render in 
template.

Instead,i want to display the checked choice alone in to display and while 
display check box is not necessary.I want to know how to do this.

Need help.

Thanks


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to