On 1/19/07, Patrick J. Anderson <[EMAIL PROTECTED]> wrote: > > Hi, I was wondering if it is possible, and if so then how, to have a > context-sensitive 'upload_to' parameter set for FileField. > > Let's say, I have the following model concept: > > class MyModel(models.Model): > folder = models.CharField(maxlength = 8) > file_html = models.FileField(upload_to = '%s/html' % x) > file_pdf = models.FielField(upload_to = '%s/pdf' % x)
The inflexibility of 'upload_to' has been discussed a few times in this list. If you search through, you should be able to find one or two solutions. None of them are great, but they're all that's available. Many moons ago, I submitted a patch that allowed custom upload_to. No idea if it would work against the current trunk, but you can try, 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@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 -~----------~----~----~----~------~----~------~--~---