On 6/13/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
>
> On 6/13/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
> > On 6/13/06, Jay Parlar <[EMAIL PROTECTED]> wrote:
> > > I don't know if this was on purpose, or if it was simply forgotten,
> > > but I suggest you walk over to the desk of whoever wrote that, and
> > > smack them on the head :)
> >
> > Perhaps refactor to UploadField or somesuch while you're at it.  ;-)
>
> Nevermind, I'm a dork.  Problem is in view, not model/field.

The model/fields could definitely use some refactoring as well. It's a
real problem that you can only use strftime in the upload_to string,
if you want some directory flexibility.

I wrote a patch (http://code.djangoproject.com/ticket/1994) that lets
you get control of the directories, if you're willing to manually call
the save_XXX_file methods. But that means it's useless when it comes
to generic views.

It'd be nice if we could do something like this:

class User(models.Model):
    username = models.CharField()
    avatar = models.ImageField(upload_to="users/" + self.username)

Obviously that doesn't work, but I think the idea is clear enough.
There's just no good way right now to present file fields to an user
without having ALL users' files going into the same directory (or some
strftime created directory).

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to