Skip to content

Don't set primary key unconditionally for every model #867

Open
@ankiaga

Description

@ankiaga

We are setting primary key unconditionally here which was leading to many test failures (and is an actual issue).
We have overcame this issue for passing different tests by commenting the code but we need to make the proper fix

For a model definition where Django would normally think that the default is NOT_PROVIDED, we set a different default. That again causes Django to behave differently here
If the pk.default had been NOT_PROVIDED (as Django expects when a normal generated primary key is being used), then force_insert=True had not been set

Please see more details here https://code.djangoproject.com/ticket/33052.

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/python-spanner-django API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions