Hi,
I have been trying to extend the UserCreationForm and have a form which
performs user registration and adds email and the names.
In addition I am using a choice field that allows a list down of existing
groups so that you can assign the user to an group immediately upon
creation.
The prob
On Wed, Mar 19, 2014 at 3:40 PM, sashank reddy
wrote:
> Hi,
>
> I have been trying to extend the UserCreationForm and have a form which
> performs user registration and adds email and the names.
> In addition I am using a choice field that allows a list down of existing
> groups so that you can as
Hi Tom,
What do you mean callable?
I tried changing
desig_group = forms.ChoiceField(choices=choice_desig())
to
desig_group = forms.ChoiceField(choices=choice_desig)
It gave error 'function' object is not iterable.
But I want to know if the following would work.
desig = forms.ModelChoiceField(
Hi Tom,
I have not understood what you have said. Shouldn't choice_desig be called
every time I instantiate it in the view with the form = New_user_form(). I
thought I was creating an object of New_user_form every time I do that.
Regards,
Preetam
On Wednesday, 19 March 2014 22:11:52 UTC+5:30,
On Thu, Mar 20, 2014 at 10:12 AM, sashank reddy
wrote:
> Hi Tom,
>
> I have not understood what you have said. Shouldn't choice_desig be called
> every time I instantiate it in the view with the form = New_user_form(). I
> thought I was creating an object of New_user_form every time I do that.
Th
Hi Tom,
I did try an override meanwhile.
I added,
def initialize_designation(self):
print("Initializing designation")
self.desig_group = forms.ChoiceField(choices=choice_des())
return
to my form class.
This will override the desig_group that is previously declared.
I call this in the view after
Tom,
In addition it still doesn't explain why I am unable to traceback the point
of exception.
How can there be an exception when the only thing there are are few perfect
prints
I am always invariably getting the
"Validation completed print"
for desig_name field.
Then I get
"BaseForm: _clea
Hi Tom,
As per your first suggestion I tried a ModelChoiceField in place of
ChoiceField.
It also results in a validation error.
I am putting my new code here.
=
class New_user_form(UserCreationForm):
email = forms.Ema
8 matches
Mail list logo