Skip to content

Commit

Permalink
Reduce length of the lines for the sake of pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
voron434 committed Feb 9, 2021
1 parent 5ce2dfc commit 3267b32
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions blog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@ class Post(models.Model):
image = models.ImageField("Картинка")
published_at = models.DateTimeField("Дата и время публикации")

author = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="Автор", limit_choices_to={'is_staff': True})
likes = models.ManyToManyField(User, related_name="liked_posts", verbose_name="Кто лайкнул", blank=True)
author = models.ForeignKey(
User,
on_delete=models.CASCADE,
verbose_name="Автор",
limit_choices_to={'is_staff': True})
likes = models.ManyToManyField(
User,
related_name="liked_posts",
verbose_name="Кто лайкнул",
blank=True)

def __str__(self):
return self.title
Expand All @@ -26,8 +34,14 @@ class Meta:


class Comment(models.Model):
post = models.ForeignKey("Post", on_delete=models.CASCADE, verbose_name="Пост, к которому написан")
author = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="Автор")
post = models.ForeignKey(
"Post",
on_delete=models.CASCADE,
verbose_name="Пост, к которому написан")
author = models.ForeignKey(
User,
on_delete=models.CASCADE,
verbose_name="Автор")

text = models.TextField("Текст комментария")
published_at = models.DateTimeField("Дата и время публикации")
Expand Down

0 comments on commit 3267b32

Please sign in to comment.