mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 00:04:16 +03:00
Moving models back to test_serializer.
This commit is contained in:
parent
ef742f2d46
commit
5a662dd60e
|
@ -170,26 +170,6 @@ class BasicModelSerializer(serializers.ModelSerializer):
|
||||||
model = BasicModel
|
model = BasicModel
|
||||||
|
|
||||||
|
|
||||||
# Models to test the serializers
|
|
||||||
class AMOAFModel(RESTFrameworkModel):
|
|
||||||
char_field = models.CharField(max_length=1024, blank=True)
|
|
||||||
comma_separated_integer_field = models.CommaSeparatedIntegerField(max_length=1024, blank=True)
|
|
||||||
decimal_field = models.DecimalField(max_digits=64, decimal_places=32, blank=True)
|
|
||||||
email_field = models.EmailField(max_length=1024, blank=True)
|
|
||||||
file_field = models.FileField(upload_to='test', max_length=1024, blank=True)
|
|
||||||
image_field = models.ImageField(upload_to='test', max_length=1024, blank=True)
|
|
||||||
slug_field = models.SlugField(max_length=1024, blank=True)
|
|
||||||
url_field = models.URLField(max_length=1024, blank=True)
|
|
||||||
|
|
||||||
class DVOAFModel(RESTFrameworkModel):
|
|
||||||
positive_integer_field = models.PositiveIntegerField(blank=True)
|
|
||||||
positive_small_integer_field = models.PositiveSmallIntegerField(blank=True)
|
|
||||||
email_field = models.EmailField(blank=True)
|
|
||||||
file_field = models.FileField(upload_to='test', blank=True)
|
|
||||||
image_field = models.ImageField(upload_to='test', blank=True)
|
|
||||||
slug_field = models.SlugField(blank=True)
|
|
||||||
url_field = models.URLField(blank=True)
|
|
||||||
|
|
||||||
# Models to test filters
|
# Models to test filters
|
||||||
class FilterableItem(models.Model):
|
class FilterableItem(models.Model):
|
||||||
text = models.CharField(max_length=100)
|
text = models.CharField(max_length=100)
|
||||||
|
|
|
@ -8,12 +8,32 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
from rest_framework import serializers, fields, relations
|
from rest_framework import serializers, fields, relations
|
||||||
from rest_framework.tests.models import (HasPositiveIntegerAsChoice, Album, ActionItem, Anchor, BasicModel,
|
from rest_framework.tests.models import (HasPositiveIntegerAsChoice, Album, ActionItem, Anchor, BasicModel,
|
||||||
BlankFieldModel, BlogPost, BlogPostComment, Book, CallableDefaultValueModel, DefaultValueModel,
|
BlankFieldModel, BlogPost, BlogPostComment, Book, CallableDefaultValueModel, DefaultValueModel,
|
||||||
ManyToManyModel, Person, ReadOnlyManyToManyModel, Photo, RESTFrameworkModel, AMOAFModel, DVOAFModel)
|
ManyToManyModel, Person, ReadOnlyManyToManyModel, Photo, RESTFrameworkModel)
|
||||||
from rest_framework.tests.models import BasicModelSerializer
|
from rest_framework.tests.models import BasicModelSerializer
|
||||||
import datetime
|
import datetime
|
||||||
import pickle
|
import pickle
|
||||||
|
|
||||||
|
|
||||||
|
class AMOAFModel(RESTFrameworkModel):
|
||||||
|
char_field = models.CharField(max_length=1024, blank=True)
|
||||||
|
comma_separated_integer_field = models.CommaSeparatedIntegerField(max_length=1024, blank=True)
|
||||||
|
decimal_field = models.DecimalField(max_digits=64, decimal_places=32, blank=True)
|
||||||
|
email_field = models.EmailField(max_length=1024, blank=True)
|
||||||
|
file_field = models.FileField(upload_to='test', max_length=1024, blank=True)
|
||||||
|
image_field = models.ImageField(upload_to='test', max_length=1024, blank=True)
|
||||||
|
slug_field = models.SlugField(max_length=1024, blank=True)
|
||||||
|
url_field = models.URLField(max_length=1024, blank=True)
|
||||||
|
|
||||||
|
class DVOAFModel(RESTFrameworkModel):
|
||||||
|
positive_integer_field = models.PositiveIntegerField(blank=True)
|
||||||
|
positive_small_integer_field = models.PositiveSmallIntegerField(blank=True)
|
||||||
|
email_field = models.EmailField(blank=True)
|
||||||
|
file_field = models.FileField(upload_to='test', blank=True)
|
||||||
|
image_field = models.ImageField(upload_to='test', blank=True)
|
||||||
|
slug_field = models.SlugField(blank=True)
|
||||||
|
url_field = models.URLField(blank=True)
|
||||||
|
|
||||||
|
|
||||||
class SubComment(object):
|
class SubComment(object):
|
||||||
def __init__(self, sub_comment):
|
def __init__(self, sub_comment):
|
||||||
self.sub_comment = sub_comment
|
self.sub_comment = sub_comment
|
||||||
|
|
Loading…
Reference in New Issue
Block a user