Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit 324f899

Browse files
author
Vlad Ponomarov
committed
31 fix small code part
1 parent 181b66d commit 324f899

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lesson31.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class Author(models.Model):
3333
class Article(models.Model):
3434
author = models.ForeignKey(Author, on_delete=models.CASCADE, null=True, related_name='articles')
3535
text = models.TextField(max_length=10000, null=True)
36-
created_at = models.DateTimeField(default=timezone.now)
37-
updated_at = models.DateTimeField(default=timezone.now)
36+
created_at = models.DateTimeField(auto_now_add=True)
37+
updated_at = models.DateTimeField(auto_now=True)
3838
genre = models.IntegerField(choices=GENRE_CHOICES, default=1)
3939

4040
def __str__(self):

0 commit comments

Comments
 (0)