Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. from django.db import models
  2.  
  3. # Create your models here.
  4. class Article(models.Model):
  5. class Meta():
  6. db_table = 'article'
  7.  
  8. article_title = models.CharField(max_length = 200)
  9. article_text = models.TextField()
  10. article_date = models.DateTimeField()
  11. article_likes = models.IntegerField(default = 0) #or blank = True, null = True
  12.  
  13. class Comments(models.Model):
  14. class Meta():
  15. db_table = 'comments'
  16.  
  17. comments_text = models.TextField()
  18. comments_article = models.ForeignKey(Article)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement