OMG!
excellent, kevin... just what i wanted!
works smooth and nice
thanks a lot
;)
On Apr 29, 12:42 pm, Kevin Audleman wrote:
> You're in luck, I just programmed this exact thing:
>
> Define the following function right above your model:
>
> def upload_location(instance, filename):
> ret
You're in luck, I just programmed this exact thing:
Define the following function right above your model:
def upload_location(instance, filename):
return 'profile_photos/%s/%s' % (instance.user.username,
filename)
My function uses 'profile_photos' as the base directory appended to
MEDIA
thanks...
but...
how can i make that attribute a callable tto work with user-specif
paths??
On 29 abr, 03:18, Kip Parker wrote:
> upload_to can be a callable
> -http://docs.djangoproject.com/en/dev/ref/models/fields/#filefield.
>
> On Apr 29, 4:59 am, "Carlos A. Carnero Delgado"
>
> wrote:
> >
upload_to can be a callable -
http://docs.djangoproject.com/en/dev/ref/models/fields/#filefield.
On Apr 29, 4:59 am, "Carlos A. Carnero Delgado"
wrote:
> Oops, too quick to press reply :o
>
> On Tue, Apr 28, 2009 at 11:53 PM, Carlos A. Carnero Delgado >
> destination_file = open('somewhere base
Oops, too quick to press reply :o
On Tue, Apr 28, 2009 at 11:53 PM, Carlos A. Carnero Delgado >
destination_file = open('somewhere based on the user', 'wb+')
> for chunk in request.FILES['audio_file'].chunks():
> destination_file.write(chunk)
> destination_file.close()
with this method yo
Hello,
2009/4/28 Julián C. Pérez :
>
> anyone??
> how can i make that happen??
What's wrong with having something like the following in the view that
processes the form?
destination_file = open('somewhere based on the user', 'wb+')
for chunk in request.FILES['audio_file'].chunks():
de
ok, you're right... sorry for the rush
i can wait
;)
On Apr 28, 8:12 pm, Russell Keith-Magee
wrote:
> 2009/4/29 Julián C. Pérez :
>
>
>
> > anyone??
> > how can i make that happen??
>
> You asked your original question 4 hours ago. This is an international
> mailing list. Many of the audience fo
2009/4/29 Julián C. Pérez :
>
> anyone??
> how can i make that happen??
You asked your original question 4 hours ago. This is an international
mailing list. Many of the audience for your message are asleep. Please
show some patience.
If you have a more immediate need please try a more immediate
anyone??
how can i make that happen??
On Apr 28, 3:41 pm, Julián C. Pérez wrote:
> hi u all
> i'm progressing in my django wisdom jeje
> but everyday i face new challenges and/or problems...
> 'im working on a uploading files application...
> and i want to store every uploaded file into its righ
hi u all
i'm progressing in my django wisdom jeje
but everyday i face new challenges and/or problems...
'im working on a uploading files application...
and i want to store every uploaded file into its right path, arranged
by username
example...
if a user called 'user123' uploads a file from a reg
10 matches
Mail list logo