Add missed files for test.

This commit is contained in:
Brandon Cazander 2015-01-24 01:44:09 -08:00
parent b09ef28959
commit 0ee2edc0a1
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,9 @@
from django.db import models
class Foo(models.Model):
name = models.CharField(max_length=30)
class Bar(models.Model):
foo = models.ForeignKey("Foo", editable=False)

View File

@ -0,0 +1,14 @@
from .models import Foo, Bar
from rest_framework.serializers import HyperlinkedModelSerializer, HyperlinkedIdentityField
class FooSerializer(HyperlinkedModelSerializer):
bar = HyperlinkedIdentityField(view_name='bar-list')
class Meta:
model = Foo
class BarSerializer(HyperlinkedModelSerializer):
class Meta:
model = Bar