2👍
✅
You should change the form init decleration, that QueryDict tha gets printed is the request.GET or request.POST that you pass as first argument when you initialize the form.
i guess changing this
def __init__(self, subject_label="Subject", ...
to this
def __init__(self, data=None, subject_label="Subject", ... ...):
super(ContactForm, self).__init__(data, *args, **kwargs)
...
will solve your problem.
2👍
I think you’re approaching the problem the wrong way. You should use the internationalisatoin module instead.
That way you can have your form like this:
class ContactForm(forms.Form):
subject = forms.CharField(label=_('contact_form_subject'), widget=forms.TextInput(attrs={'size':'60'}))
The Django internationalisation system will automatically insert the correct translation for you if you provide the translation files.
- [Django]-Django admin not working with custom auth backend
- [Django]-Add custom button near Save button Django-admin
- [Django]-Is there a way to update the database with the changes in my models?
- [Django]-Json to python dictionary covertion return in random order
Source:stackexchange.com