mirror of
https://github.com/django/django.git
synced 2025-08-11 14:28:54 +00:00

Pickling a `SimpleLazyObject` wrapping a model did not work correctly; in particular it did not add the `_django_version` attribute added in42736ac8
. Now it will handle this and other custom `__reduce__` methods correctly. Backport of35355a4ffe
from master
17 lines
344 B
Python
17 lines
344 B
Python
from django.db import models
|
|
|
|
|
|
class Category(models.Model):
|
|
name = models.CharField(max_length=100)
|
|
|
|
def next(self):
|
|
return self
|
|
|
|
|
|
class Thing(models.Model):
|
|
name = models.CharField(max_length=100)
|
|
category = models.ForeignKey(Category)
|
|
|
|
|
|
class CategoryInfo(models.Model):
|
|
category = models.OneToOneField(Category)
|