#11027: Storage backends should know about the max_length attribute of the
FileFields
------------------------------------+--------------------------------------
               Reporter:  apollo13  |          Owner:  nobody
                   Type:  Bug       |         Status:  new
              Milestone:  1.3       |      Component:  File uploads/storage
                Version:  SVN       |       Severity:  Normal
             Resolution:            |       Keywords:
           Triage Stage:  Accepted  |      Has patch:  0
    Needs documentation:  0         |    Needs tests:  0
Patch needs improvement:  0         |  Easy pickings:  0
------------------------------------+--------------------------------------
Changes (by carljm):

 * type:  New feature => Bug
 * easy:   => 0
 * stage:  Design decision needed => Accepted


Comment:

 Marking this as a bug, since #15247 makes it clear that's what it is.
 Discussed briefly with jezdez on IRC and concluded that the fix proposed
 here probably is the right one, adding a max_length argument to the
 get_valid_name method of storage classes. Unfortunately, this is backwards
 incompatible, and it won't just break code that was relying on buggy
 behavior, it will break all custom storage backends. So it requires a
 deprecation path, and during the deprecation period that will require
 introspecting the get_valid_name method to see whether it accepts the
 valid_name argument (or trying with, catching the error, and then trying
 without).

 Either one of those is kind of ugly, but the alternative is to introduce a
 new method, like "get_valid_name_with_max_length". That makes the
 deprecation-period code a bit nicer, but then we're stuck with the longer
 method name for good. Probably better to take the short-term hit.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/11027#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to