Advertisement
kellykamay

story model

Jun 9th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals, absolute_import
  3.  
  4. from django.conf import settings
  5. from django.contrib.postgres.fields import JSONField
  6. from django.core.urlresolvers import reverse
  7. from django.db import models
  8. from django.utils.encoding import python_2_unicode_compatible
  9.  
  10. @python_2_unicode_compatible
  11. class Story(models.Model):
  12.     owner = models.ForeignKey(settings.AUTH_USER_MODEL)
  13.     title = models.CharField(max_length=200)
  14.     date_created = models.DateTimeField(auto_now=False, auto_now_add=True)
  15.     updated = models.DateTimeField(auto_now=True, auto_now_add=False)
  16.     chapter = JSONField(null=True)
  17.  
  18.     def __str__(self):
  19.         return self.title
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement