Opened 8 months ago
Last modified 8 months ago
#35350 closed Bug
Crash on write of new instance when using GeneratedField — at Initial Version
Reported by: | Matt Hegarty | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 5.0 |
Severity: | Release blocker | Keywords: | GeneratedField |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
We have an 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 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:
- Clone this repo and use the 'issue-1779-generatedfield' branch.
- Create a venv
- Install the example app following the instructions here
- Navigate to "Books", click "Import", then select the attached sample.csv file.
- Click "Submit" and you will see the error.
Note:
See TracTickets
for help on using tickets.
sample csv for import