#35350: Crash on write of new instance when using GeneratedField
-------------------------------------+-------------------------------------
               Reporter:  Matt       |          Owner:  nobody
  Hegarty                            |
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  5.0
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:  GeneratedField
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 We have an [https://github.com/django-import-export/django-import-
 export/issues/1779 issue in django-import-export] where imports of new
 instances fails when the model has a GeneratedField.

 This occurs when an instance is being created which doesn't already exist
 in the database, which the
 [https://docs.djangoproject.com/en/5.0/ref/models/fields/#generatedfield
 docs] imply is supported by GeneratedField:

   A stored generated column is computed when it is written (inserted or
 updated)

 The stack trace is attached.

 Steps to reproduce:

 1.  Clone [https://github.com/matthewhegarty/django-import-
 export/tree/issue-1779-generatedfield this repo] and use the
 'issue-1779-generatedfield' branch.
 2.  Create a [https://django-import-
 export.readthedocs.io/en/4.0.0-rc.1/contributing.html#development venv]
 3.  Install the example app following the instructions [https://django-
 import-export.readthedocs.io/en/4.0.0-rc.1/installation.html#example-app
 here]
 4.  Navigate to "Books", click "Import", then select the attached
 sample.csv file.
 5.  Click "Submit" and you will see the error.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35350>
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/0107018ea42e07ed-c95676a2-7ab6-47aa-b95f-aec201ce4f68-000000%40eu-central-1.amazonses.com.

Reply via email to