Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.db import models
- # Create your models here.
- class Article(models.Model):
- class Meta():
- db_table = 'article'
- article_title = models.CharField(max_length = 200)
- article_text = models.TextField()
- article_date = models.DateTimeField()
- article_likes = models.IntegerField(default = 0) #or blank = True, null = True
- class Comments(models.Model):
- class Meta():
- db_table = 'comments'
- comments_text = models.TextField()
- comments_article = models.ForeignKey(Article)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement