Thanks a lot Karen!

On May 1, 4:14 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Thu, May 1, 2008 at 7:50 AM, Abdallah El Guindy <
>
> [EMAIL PROTECTED]> wrote:
> > Hey all,
>
> > I wonder how can I do something like this:
>
> > class Author(models.Model):
> >        first_name = models.CharField(maxlength=30)
> >        headshot = models.ImageField(upload_to='media/' +
> > self.first_name.__str__())
>
> > Of course this does not work, but I need to upload to a dynamically
> > specified path depending on some other attribute of the model..
>
> Long term I believe the answer for this is in #5361 
> (http://code.djangoproject.com/ticket/5361), which allows for upload_to to be
> a callable.  If you're willing to run on the bleeding edge, you could try
> out the current patch on that ticket (though it doesn't apply cleanly on
> current SVN, so you'd either have to be willing/able to fix up the patch
> failures or use the SVN version 7397, which is what the patch was built
> against).
>
> If you're not feeling that adventurous, search this group for 'dynamic
> upload_to' and you'll find pointers to other approaches you could try.
>
> Karen
--~--~---------~--~----~------------~-------~--~----~
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