Skip to content

Commit 2f03483

Browse files
committed
Removed unused models
1 parent caf1de3 commit 2f03483

File tree

1 file changed

+1
-98
lines changed

1 file changed

+1
-98
lines changed

tests/models.py

Lines changed: 1 addition & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,16 @@
33
from django.utils.translation import ugettext_lazy as _
44

55

6-
def foobar():
7-
return 'foobar'
8-
9-
10-
class CustomField(models.CharField):
11-
12-
def __init__(self, *args, **kwargs):
13-
kwargs['max_length'] = 12
14-
super(CustomField, self).__init__(*args, **kwargs)
15-
16-
176
class RESTFrameworkModel(models.Model):
187
"""
198
Base for test models that sets app_label, so they play nicely.
209
"""
10+
2111
class Meta:
2212
app_label = 'tests'
2313
abstract = True
2414

2515

26-
class HasPositiveIntegerAsChoice(RESTFrameworkModel):
27-
some_choices = ((1, 'A'), (2, 'B'), (3, 'C'))
28-
some_integer = models.PositiveIntegerField(choices=some_choices)
29-
30-
31-
class Anchor(RESTFrameworkModel):
32-
text = models.CharField(max_length=100, default='anchor')
33-
34-
3516
class BasicModel(RESTFrameworkModel):
3617
text = models.CharField(max_length=100, verbose_name=_("Text comes here"), help_text=_("Text description."))
3718

@@ -41,24 +22,6 @@ class SlugBasedModel(RESTFrameworkModel):
4122
slug = models.SlugField(max_length=32)
4223

4324

44-
class DefaultValueModel(RESTFrameworkModel):
45-
text = models.CharField(default='foobar', max_length=100)
46-
extra = models.CharField(blank=True, null=True, max_length=100)
47-
48-
49-
class CallableDefaultValueModel(RESTFrameworkModel):
50-
text = models.CharField(default=foobar, max_length=100)
51-
52-
53-
class ManyToManyModel(RESTFrameworkModel):
54-
rel = models.ManyToManyField(Anchor, help_text='Some help text.')
55-
56-
57-
class ReadOnlyManyToManyModel(RESTFrameworkModel):
58-
text = models.CharField(max_length=100, default='anchor')
59-
rel = models.ManyToManyField(Anchor)
60-
61-
6225
class BaseFilterableItem(RESTFrameworkModel):
6326
text = models.CharField(max_length=100)
6427

@@ -72,72 +35,12 @@ class FilterableItem(BaseFilterableItem):
7235

7336

7437
# Model for regression test for #285
75-
7638
class Comment(RESTFrameworkModel):
7739
email = models.EmailField()
7840
content = models.CharField(max_length=200)
7941
created = models.DateTimeField(auto_now_add=True)
8042

8143

82-
class ActionItem(RESTFrameworkModel):
83-
title = models.CharField(max_length=200)
84-
started = models.NullBooleanField(default=False)
85-
done = models.BooleanField(default=False)
86-
info = CustomField(default='---', max_length=12)
87-
88-
89-
# Models for reverse relations
90-
class Person(RESTFrameworkModel):
91-
name = models.CharField(max_length=10)
92-
age = models.IntegerField(null=True, blank=True)
93-
94-
@property
95-
def info(self):
96-
return {
97-
'name': self.name,
98-
'age': self.age,
99-
}
100-
101-
102-
class BlogPost(RESTFrameworkModel):
103-
title = models.CharField(max_length=100)
104-
writer = models.ForeignKey(Person, null=True, blank=True)
105-
106-
def get_first_comment(self):
107-
return self.blogpostcomment_set.all()[0]
108-
109-
110-
class BlogPostComment(RESTFrameworkModel):
111-
text = models.TextField()
112-
blog_post = models.ForeignKey(BlogPost)
113-
114-
115-
class Album(RESTFrameworkModel):
116-
title = models.CharField(max_length=100, unique=True)
117-
ref = models.CharField(max_length=10, unique=True, null=True, blank=True)
118-
119-
120-
class Photo(RESTFrameworkModel):
121-
description = models.TextField()
122-
album = models.ForeignKey(Album)
123-
124-
125-
# Model for issue #324
126-
class BlankFieldModel(RESTFrameworkModel):
127-
title = models.CharField(max_length=100, blank=True, null=False,
128-
default="title")
129-
130-
131-
# Model for issue #380
132-
class OptionalRelationModel(RESTFrameworkModel):
133-
other = models.ForeignKey('OptionalRelationModel', blank=True, null=True)
134-
135-
136-
# Model for RegexField
137-
class Book(RESTFrameworkModel):
138-
isbn = models.CharField(max_length=13)
139-
140-
14144
# Models for relations tests
14245
# ManyToMany
14346
class ManyToManyTarget(RESTFrameworkModel):

0 commit comments

Comments
 (0)