Re: FileField with custom upload_to

2006-06-02 Thread medhat
Jay Parlar wrote: > I went ahead and filed a patch with Trac, > http://code.djangoproject.com/ticket/1994 > > Jay P. I like this solution... actually, I was trying to achieve something similar and came up with an almost identical solution. So, I am +1 for this patch. -- Thanks, Medhat --~--~

Re: [PATCH] FileField with custom upload_to

2006-05-24 Thread Jay Parlar
I went ahead and filed a patch with Trac, http://code.djangoproject.com/ticket/1994 Jay P. --~--~-~--~~~---~--~~ 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@goog

Re: [PATCH] FileField with custom upload_to

2006-05-24 Thread Jay Parlar
On 5/24/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > I would prefer self.upload_to to be restored to its original value after > call. Otherwise a call to save_*_file with a custom parameter would > change object's "global" behavior which is very counter-intuitive. In > fact I think custom uploa

Re: [PATCH] FileField with custom upload_to

2006-05-24 Thread Ivan Sagalaev
Jay Parlar wrote: >+def save_func(instance, filename, raw_contents, upload_to=""): >+if upload_to: >+self.upload_to = upload_to >+instance._save_FIELD_file(self, filename, raw_contents) >+setattr(cls, 'save_%s_file' % self.name, save_func) >

[PATCH] FileField with custom upload_to

2006-05-24 Thread Jay Parlar
Is this patch useful/correct enough to warrant submitting a ticket? Index: django/db/models/fields/__init__.py === --- django/db/models/fields/__init__.py (revision 2970) +++ django/db/models/fields/__init__.py (working copy) @@ -56