Hi there :)
first the code:
forms:
class ProfileForm(forms.Form):
...
image = forms.ImageField(required = False)
models:
class Profile(models.Model):
user = models.ForeignKey(User, unique=True)
....
image = models.ImageField(upload_to="images/", blank=True, null=True)
views:
formP = ProfileForm(request.POST,request.FILES)
if formP.is_valid():
profile = user.get_profile()
image = formP.cleaned_data['image']
if image:
print "image test"
profile.save_image_file(image.filename,
image.content,save=False)
profile.save()
I have installed PIL and i don't get any error messages of any sort.
however if i try to print image it just prints "None". and "image
test" never gets printed.
I have also set media root and URL and all that in my settings file.
I could really use some help here :-(
Maybe i have to import something, but somehow i think that i'm not
just not getting my image file back.
Oh and i have tried .png aswell as .jpeg
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---