﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35350	Crash on write of new instance when using GeneratedField	Matt Hegarty	Sarah Boyce	"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.

* python 3.12
* django 5.0.3
"	Bug	closed	Database layer (models, ORM)	5.0	Release blocker	fixed	GeneratedField		Ready for checkin	1	0	0	0	0	0
