OTHER_VALUE = "the query that i run"
if request.method=='POST':
form = MY_FORM(request.POST, OTHER_VALUE)
class MY_FORM(forms.Form):
real_value = forms.CharField()
def clean_real_value(self):
if OTHER_VALUE ...
__init__() got an unexpected keyword argument 'OTHER_VALUE'
class MY_FORM(forms.Form):
real_value = forms.CharField()
def __init__(self, *args, **kwargs):
OTHER_VALUE = kwargs.pop('OTHER_VALUE')
super(MY_FORM, self).__init__(*args, **kwargs)
Exception Value: 'employee'
Exception Location: /Users/macbook/Desktop/OrgDB/orgchart/forms.py in __init__, line 42
MY_FORM(request.POST, OTHER_VALUE=OTHER_VALUE)
--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/61a17825-0a19-4573-8893-49e1b715d045%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
def __init__(self, *args, **kwargs):
OTHER_VAL = kwargs.get('OTHER_VAL') #tried these: #kwargs['OTHER_VAL'] #kwargs.pop('OTHER_VAL')
super(MY_FORM, self).__init__(*args, **kwargs)
`KeyError: 'OTHER_VAL'`
# or
__init__() got an unexpected keyword argument 'OTHER_VAL'