#24368: FileField needlessly serializes upload_to
-------------------------------+--------------------------------------
     Reporter:  rdaysky        |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  new
    Component:  Migrations     |                  Version:  1.7
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Changes (by rdaysky):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Old description:

> django.db.models.fields.FileField explicitly includes upload_to in the
> serialization process. This takes no part in the actual migration process
> but causes errors if the value of the field is a lambda function.
> Instead, the deconstruct() functions for FileField and other fields
> should only serialize arguments relevant to subsequent ALTER commands
> issued to the DBMS.
>
> Other places where this problem arises include
> ForeignKey.limit_choices_to — do changes to this attribute mandate a new
> migration and is it appropriate to have it fail if the value is a lambda?
>
> Once fixed, #22351 can be reverted.

New description:

 django.db.models.fields.FileField explicitly includes upload_to in the
 serialization process. This takes no part in the actual migration process
 but causes errors if the value of the field is a lambda function. Instead,
 the deconstruct() functions for FileField and other fields should only
 serialize arguments relevant to subsequent ALTER commands issued to the
 DBMS.

 Once fixed, #22351 can be reverted.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/24368#comment:1>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.a90fcf075b7cdec25146953863c926bd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to