I'd like to create a new comment programatically. My use case is that I'd like to automatically create the first comment for a blog_post when the blog_post is first created.
I have the comment text, the user object, and the model instance. Can I do something like:
I'd like to create a new comment programatically. My use case is that I'd like to automatically create the first comment for a blog_post when the blog_post is first created.
I have the comment text, the user object, and the model instance. Can I do something like:
new_comment = Comment( comment="Some Text", user=some_user, object=some_object )
Would something like this work? Thanks!