#33993: Allow instance to be passed into the FileField storage callable param
-------------------------------------+-------------------------------------
     Reporter:  Viicos               |                    Owner:  nobody
         Type:  New feature          |                   Status:  closed
    Component:  File                 |                  Version:  dev
  uploads/storage                    |
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:  callable, storage,   |             Triage Stage:
  filefield                          |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

 Currently, the storage is instantiated at model definition time (when the
 field is instantiated as the model class definition is processed). There
 is no instance at that time. So, there would need to be on-access update
 (via a property, likely) to add the instance info. (How handling access
 without an instance would need to be looked at.)

 The same goes for the filename. Is it always available? What complexities
 would need to be handled if not? 🤔

 None of that's to say it couldn't work, but a proof-of-concept showing it
 would help.
 I hope that makes sense.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33993#comment:4>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070183325f3f11-f92f37c2-193c-4eb9-9273-94b63d4bf3ad-000000%40eu-central-1.amazonses.com.

Reply via email to