Exemplo n.º 1
0
def create_comment(url, author_name, author_site, author_gravatar, message):
    created = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    comment = Comment(
        url=url,
        author_name=author_name,
        author_site=author_site,
        author_gravatar=author_gravatar,
        content=message,
        created=created,
        notified=None,
        published=None,
    )
    comment.save()
    return comment
Exemplo n.º 2
0
def publish_comment(comment: Comment):
    comment.published = datetime.now().strftime(TIME_FORMAT)
    comment.save()
Exemplo n.º 3
0
def notify_comment(comment: Comment):
    comment.notified = datetime.now().strftime(TIME_FORMAT)
    comment.save()