solved! Here the code:
class NameURLForm(forms.ModelForm):
class Meta:
model = NameURL
def __init__(self, *args, **kwargs):
super(NameURLForm, self).__init__(*args, **kwargs)
listURL = []
for name, L in get_resolver(None).reverse_dict.items():
if type(name) is not FunctionType:
listURL.append((name, name))
listURL.sort()
self.fields['nameStart'] =
forms.ChoiceField(choices=listURL,label=_("URL di partenza"))
self.fields['nameEnd'] =
forms.ChoiceField(choices=listURL,label=_("URL di arrivo"))
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/926eeb84-b28c-4277-b707-f4e918b83a87%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.