python - Image upload and rename with django -


i'm having trouble getting work:

def _get_image_name(filename):     return 'asdf'   class imageuploadform(forms.form):     name = forms.charfield()     file = forms.imagefield(upload_to=_get_image_name) 

when running this, i'm getting "init() got unexpected keyword argument 'upload_to'". django version 1.6.

the upload_to parameter models.imagefield only. forms.imagefield you're using works differently. find documentation here.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -