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
Post a Comment