I am making a photo gallery as a project from school and I got stuck
on the uploading picture part of it. Initially I started with the
oldforms and I successfully uploaded pictures. But I have 2 questions.
So I have this code:
if request.method == 'POST':
# If data was POSTed, we're trying to create a new Place.
new_data = request.POST.copy()
new_data.update(request.FILES)
OK, here is the part where I want to take the name of the picture,
rename it with its corresponding ID[dot]the_extension and save it in
the table. I think that they are 2-3 lines of code, but i don't know
the functions.
Secondly, I want to ask if that:
new_data["user"] = User.objects(id=1)
is the right way to populate the user column in the very same table
( again with the oldforms ).
And lastly - is there a way to upload pictures with the new form
engine.
Thanks !
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---