Moved choices inside of test models per coding style.

This commit is contained in:
Manan 2018-12-10 19:58:49 +05:30 committed by Tim Graham
parent f0082b9a77
commit 3a4558b84f
4 changed files with 27 additions and 34 deletions

View file

@ -11,18 +11,6 @@ from django.db import models
temp_storage_dir = tempfile.mkdtemp()
temp_storage = FileSystemStorage(temp_storage_dir)
ARTICLE_STATUS = (
(1, 'Draft'),
(2, 'Pending'),
(3, 'Live'),
)
ARTICLE_STATUS_CHAR = (
('d', 'Draft'),
('p', 'Pending'),
('l', 'Live'),
)
class Person(models.Model):
name = models.CharField(max_length=100)
@ -51,6 +39,11 @@ class Writer(models.Model):
class Article(models.Model):
ARTICLE_STATUS = (
(1, 'Draft'),
(2, 'Pending'),
(3, 'Live'),
)
headline = models.CharField(max_length=50)
slug = models.SlugField()
pub_date = models.DateField()
@ -239,6 +232,11 @@ class Triple(models.Model):
class ArticleStatus(models.Model):
ARTICLE_STATUS_CHAR = (
('d', 'Draft'),
('p', 'Pending'),
('l', 'Live'),
)
status = models.CharField(max_length=2, choices=ARTICLE_STATUS_CHAR, blank=True, null=True)