I guess you don't have a hint for me to get this working? It seems like
everyone's having that rename issue where _get_pk returns none. I'm just
blind-guessing, but perhaps the way to go might be "moving" the file on
post_save onto another name, since pre_save doesn't provide a pk value?

I don't know the Django internals good enough to solve this myself,
though I need to get this done ASAP. In a previous project I "solved"
this with some really ugly workarounds, that my client has to take care
of constantly, and I wouldn't like to do the same this time.

Of course, the best solution would be including this functionality in
the django core, since everything else is bound to get obsolete sooner
or later, and most people wouldn't bother updating this to keep it up
with the trunk.

I've gone trough the links below, and got some of it working, but the pk
thing doesn't work on any of them.

Any help, please?

~ Chris

El mar, 20-11-2007 a las 15:41 -0500, Marty Alchin escribi�:
> On Nov 20, 2007 3:33 PM, Chris Hoeppner <[EMAIL PROTECTED]> wrote:
> > It would be nice to be able to include this in the upload_to parameter.
> > Something like
> > 'upload/%(model_name)s/%(instance_id)s.%(mimetype_extension)s' perhaps?
> > Maybe, if the parameter ends with a slash, the handler could know "ok.
> > this is a directory. let's keep the original filename".
> 
> As usual, I'll respond to this as I've been doing a good bit of work
> in this area lately. There's no "official" way to do this yet, but
> there are ways to get the job done. Take a look at the links below for
> more information on some techniques.
> 
> I'm doing a good bit of work on making Django handle renaming a bit
> better, and I'm hoping it will land during the next sprint on December
> 1. There's no guarantee of that, of course, but that's my personal
> goal. That will be documented thoroughly when it lands, and I'll make
> an announcement here on django-users whenever that is, sprint or not.
> 
> -Gul
> 
> http://scottbarnham.com/blog/2007/07/31/uploading-images-to-a-dynamic-path-with-django/
> http://code.djangoproject.com/wiki/CustomUploadAndFilters
> http://gulopine.gamemusic.org/2007/11/customizing-filenames-without-patching.html
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to