1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #32442 -- Used converters on returning fields from INSERT statements.

This commit is contained in:
Adam Johnson
2021-02-13 08:58:24 +00:00
committed by Mariusz Felisiak
parent 619f26d289
commit d9de74141e
4 changed files with 47 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ this behavior by explicitly adding ``primary_key=True`` to a field.
from django.db import models
from .fields import MyAutoField
from .fields import MyAutoField, MyWrapperField
class Employee(models.Model):
@@ -31,8 +31,12 @@ class Business(models.Model):
class Bar(models.Model):
id = MyAutoField(primary_key=True, db_index=True)
id = MyWrapperField(primary_key=True, db_index=True)
class Foo(models.Model):
bar = models.ForeignKey(Bar, models.CASCADE)
class CustomAutoFieldModel(models.Model):
id = MyAutoField(primary_key=True)