mirror of
https://github.com/django/django.git
synced 2024-12-01 15:42:04 +01:00
35355a4ffe
Pickling a `SimpleLazyObject` wrapping a model did not work correctly; in
particular it did not add the `_django_version` attribute added in 42736ac8
.
Now it will handle this and other custom `__reduce__` methods correctly.
18 lines
376 B
Python
18 lines
376 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, models.CASCADE)
|
|
|
|
|
|
class CategoryInfo(models.Model):
|
|
category = models.OneToOneField(Category, models.CASCADE)
|