aboutsummaryrefslogtreecommitdiffstats
path: root/examples/blogpost/models.py
diff options
context:
space:
mode:
authorTom Christie2012-02-25 18:45:17 +0000
committerTom Christie2012-02-25 18:45:17 +0000
commit1cde31c86d9423e9b7a7409c2ef2ba7c0500e47f (patch)
treeea24bce0f24507aa43f408776ccf7324f204256d /examples/blogpost/models.py
parent5fd4c639d7c64572dd07dc31dcd627bed9469b05 (diff)
downloaddjango-rest-framework-1cde31c86d9423e9b7a7409c2ef2ba7c0500e47f.tar.bz2
Massive merge
Diffstat (limited to 'examples/blogpost/models.py')
-rw-r--r--examples/blogpost/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/blogpost/models.py b/examples/blogpost/models.py
index d77f530d..10732ab4 100644
--- a/examples/blogpost/models.py
+++ b/examples/blogpost/models.py
@@ -2,6 +2,7 @@ from django.db import models
from django.template.defaultfilters import slugify
import uuid
+
def uuid_str():
return str(uuid.uuid1())
@@ -14,6 +15,7 @@ RATING_CHOICES = ((0, 'Awful'),
MAX_POSTS = 10
+
class BlogPost(models.Model):
key = models.CharField(primary_key=True, max_length=64, default=uuid_str, editable=False)
title = models.CharField(max_length=128)
@@ -37,4 +39,3 @@ class Comment(models.Model):
comment = models.TextField()
rating = models.IntegerField(blank=True, null=True, choices=RATING_CHOICES, help_text='How did you rate this post?')
created = models.DateTimeField(auto_now_add=True)
-