diff options
Diffstat (limited to 'examples/blogpost/models.py')
| -rw-r--r-- | examples/blogpost/models.py | 3 |
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) - |
