I am trying to display a list of tags as tag.name (instead of a list). However, when I try to start the for loop on the list, it throws a "Caught TypeError when rendering: the" BoundField "object is not iterable."
<dd>{% for tag in form.tags %}{{tag.name}}{% endfor %}</dd>
Iterating through .all will load the page, but will not display the Tags field.
<dd>{% for tag in form.tags.all %}{{tag.name}}{% endfor %}</dd> class Profile(models.Model): user = models.ForeignKey(User) tagging.register(Profile) form = ProfileForm(initial={ "fullname":fullname, "location":request.user.get_profile().location, "website":request.user.get_profile().website, "twitter_account":request.user.get_profile().twitter_account, "email":request.user.email, "bio":request.user.get_profile().bio, "tags":request.user.get_profile().tags }) class ProfileForm(forms.Form): fullname = forms.CharField( label=_("Full Name"), widget=forms.TextInput(), required=False) location = forms.CharField( label=_("Location"), widget=forms.TextInput(), required=False) website = forms.CharField( label=_("Website"), widget=forms.TextInput(), required=False) twitter_account = forms.CharField( label=_("Twitter"), widget=forms.TextInput(), required=False) bio = forms.CharField( label=_("Bio"), widget=forms.Textarea(), required=False) tags = forms.CharField( label=_("Keywords"), widget=forms.Textarea(), required=False)
Thank you very much in advance!
Emile source share