On 10/28/07, Yuri Baburov <[EMAIL PROTECTED]> wrote:
> How about introducing new argument, and allowing to use only one or another?
>
> so, variant 1 (backward-compatible one):
> my_file = models.FileField(upload_to="%Y/%m/%d")
>
> variant 2 (works only in new revisions):
> my_file = models.FileField(upload_to=get_file_path)
>
> def get_file_path(obj):
>     return "%s/%s/" % (datetime.now.strftime("%Y/%m/%d"), obj.type)
>
> variant 3 (works only in new revisions):
> my_file = models.FileField(filename=get_file_path)
>
> def get_file_path(obj, filename):
>     return "%s/%s/%s" % (datetime.now.strftime("%Y/%m/%d"), obj.id, filename)

Well, the original idea was indeed to offer a new argument for
cusotmizing things. What I definitely don't want to do, though, is to
offer three separate options, as you're proposing. I wasn't completely
opposed to a choice of two arguments, but also offering a callable to
be passed to upload_to ... I don't want to go there. Just documenting
it would be a nightmare. :(

-Gul

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

Reply via email to