thanks for dball's comments.
i rewrite myproject/form.py in your way, and user can get the new
Choices list.
but when they submit to the server. they will get the error message:
[Select a valid choice. That choice is not one of the available
choices.]
so i just move CancelForm from form.py to
Sorry, first post had an error.
class CancelForm(forms.Form):
name = forms.CharField(label="name", max_length=10)
no = forms.CharField(label="personalid", max_length=10)
unit = forms.ChoiceField(label="unitname", choices=[])
def __init__(self,*args,**kwargs):
On 23 Kwi, 15:44, hoamon <[EMAIL PROTECTED]> wrote:
> Hi there~
>
> I have a ChoiceField() of [newforms] in CancelForm,
> it's choices list is depending on database table sign2.
> my source code is below.
>
> --
> from django import newforms as forms
> class CancelForm(forms.Form):
> U_hash =
Hi there~
I have a ChoiceField() of [newforms] in CancelForm,
it's choices list is depending on database table sign2.
my source code is below.
--
from django import newforms as forms
class CancelForm(forms.Form):
U_hash = {}
for U in Sign2.objects.all():
U_hash[U.unit.id] =
4 matches
Mail list logo