Update post

This commit is contained in:
Andros Fenollosa
2021-03-12 00:09:19 +01:00
parent ae05e3a6f1
commit 901226c700
7 changed files with 127 additions and 63 deletions

View File

@@ -13,9 +13,6 @@ class Post(models.Model):
status = models.IntegerField(choices=STATUS, default=0)
created_on = models.DateTimeField(auto_now_add=True)
class Meta:
ordering = ['-created_on']
def __str__(self):
return self.title
@@ -25,8 +22,5 @@ class Comment(models.Model):
post = models.ForeignKey(Post, on_delete= models.CASCADE)
created_on = models.DateTimeField(auto_now_add=True)
class Meta:
ordering = ['-created_on']
def __str__(self):
return self.name