mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-09-22 11:59:04 +03:00
17 lines
443 B
Python
17 lines
443 B
Python
from __future__ import unicode_literals
|
|
from django.db import models
|
|
from rest_framework.tests.models import RESTFrameworkModel
|
|
|
|
|
|
class ParentModel(RESTFrameworkModel):
|
|
name1 = models.CharField(max_length=100)
|
|
|
|
|
|
class ChildModel(ParentModel):
|
|
name2 = models.CharField(max_length=100)
|
|
|
|
|
|
class AssociatedModel(RESTFrameworkModel):
|
|
ref = models.OneToOneField(ParentModel, primary_key=True)
|
|
name = models.CharField(max_length=100)
|