Skip to content

Commit

Permalink
Update docstrings
Browse files Browse the repository at this point in the history
Ref #16
  • Loading branch information
Martolivna committed Sep 11, 2023
1 parent 4987822 commit c49ed7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions blog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


class Post(models.Model):
"""A class to represent a post."""
"""A blog post model."""

author = models.ForeignKey(
settings.AUTH_USER_MODEL, on_delete=models.CASCADE,
Expand All @@ -17,10 +17,10 @@ class Post(models.Model):
published_date = models.DateTimeField(blank=True, null=True)

def publish(self):
"""Save the post entry."""
"""Mark the post published."""
self.published_date = timezone.now
self.save()

def __str__(self):
"""Return the post title."""
"""Render a Post representation as a string."""
return str(self.title)

0 comments on commit c49ed7b

Please sign in to comment.