Opened 8 months ago
Last modified 8 months ago
#35350 closed Bug
Crash on write of new instance when using GeneratedField — at Version 1
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 (last modified by )
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.
- python 3.12
- django 5.0.3
Change History (3)
by , 8 months ago
Attachment: | sample.csv added |
---|
comment:1 by , 8 months ago
Description: | modified (diff) |
---|
Note:
See TracTickets
for help on using tickets.
sample csv for import