1
0
mirror of https://github.com/django/django.git synced 2025-01-27 02:29:55 +00:00
django/tests/serializers/models/multi_table.py
Tim Graham 631f4ab061 Removed Manager.use_for_related_fields and Meta.manager_inheritance_from_future.
Per deprecation timeline. Refs ed0ff913c648b16c4471fc9a9441d1ee48cb5420.
2017-01-17 20:52:04 -05:00

20 lines
437 B
Python

from django.db import models
class ParentManager(models.Manager):
def get_by_natural_key(self, parent_data):
return self.get(parent_data=parent_data)
class Parent(models.Model):
parent_data = models.CharField(max_length=30, unique=True)
objects = ParentManager()
def natural_key(self):
return (self.parent_data, )
class Child(Parent):
child_data = models.CharField(max_length=30, unique=True)