django - __init__() got an unexpected keyword argument 'attrs' -


forms.py

class importexcelform(form):     file  = forms.filefield(attrs={'class':'rounded_list',}) 

i trying add css class filefield in forms.i getting error "__init__() got unexpected keyword argument 'attrs'"

what did wrong.

thanks

attrs not argument field, it's argument widget.

file = forms.fieldfield(widget=forms.fileinput(attrs={'class': 'rounded_list'})) 

note browsers don't allow styling of file input.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -