Hello,

I'm creating a subset of a ModelForm.

class FavArtistForm(ModelForm):
    class Meta:
        model = FavArtist
        fields = ('artist',)
        widgets = { 
            'artist': CharField(),
        }   
        


The field artist is of the type ForeignKey which is by default represented by 
django as a select tag.
I'd rather have the user enter their own value, so I tried to change it to the 
CharField field. 
This doesn't work. 

I'm receiving the following error: AttributeError: 'CharField' object has no 
attribute 'is_hidden'


Is changing the default representation of a ForeignKey field not allowed in 
django or am I missing something ?


Regards,

Jonas.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to