Sorry, this is the actual code: views.py
def parent(request): user = request.user key = user.get_profile().link p = Parent.objects.get(pk = key) children = p.children.all() if request.method == 'POST': form = ComentForm(request.POST, children???) if form.is_valid(): cd = form.cleaned_data c = Coments(from=cd['from'], comentario=cd['coment']) c.save() return render_to_response('sent.html', locals()) else: form = ComentForm(children???) return render_to_response('parent.html', locals()) forms.py class ComentForm(forms.Form): def __init__(self, user_choices_list, *args, **kwargs): super(ComentForm, self).__init__(*args, **kwargs) self.fields['from'].choices = user_choices_list from = forms.ChoiceField() coment = forms.CharField(widget=forms.Textarea, label='Coment') --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---