I am trying to have a ChoiceField in a form, but it gives me this error:

    from TachlisGeredt.register_form import register

  File "/Users/kovyjacob/TachlisGeredt/TachlisGeredt/register_form.py",
line 10, in <module>

    class RegisterForm (forms.Form):

  File "/Users/kovyjacob/TachlisGeredt/TachlisGeredt/register_form.py",
line 15, in RegisterForm

    carrier = ChoiceField(choices = CARRIER_CHOICES)

NameError: name 'ChoiceField' is not defined


Here is the .py:

rom django import newforms as forms

from django.shortcuts import render

from django.http import HttpResponseRedirect

from django.core.mail import send_mail


carrier_choices = (

('@txt.freedommobile.ca', 'Freedom Mobile')

('@txt.luckymobile.ca', 'Lucky Mobile'),

)


class RegisterForm (forms.Form):

username = forms.CharField()

password = forms.CharField()

check_password = forms.CharField()

phone = froms.IntegerField(required = False)

carrier = ChoiceField(choices=carrier_choices, required = False)


I am new to django, what is the problem?

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACMwF3XpejE1-LGNwvyto%2BkcK2s9Y0udkEBGLw%3D3Tt%3DB_of1mA%40mail.gmail.com.

Reply via email to