orf/simple

post.created_at should not be updated in def edit(post_id)

Closed this issue · 2 comments

Line 215

    post.created_at = datetime.datetime.now()

The created_at will be changed, although the posts will appear first, the original created time will be broken, and will never be seen in the view page.

Without this, after updating a posts, we can see the create time and update time. But after this, we can never see the real create time, and due to the two time are the same, we can not see the update time.

orf commented

I did this because I found that if I created an old draft and eventually got round to publishing it it would appear below any newer posts that I have published, because it orders on created_at.

The original created time is set to when the original draft was created, but that's not very interesting to people viewing the blog, to them the created_time should be when the post was published.

I guess this could be worked around by having a "published_at" field, but that would require a schema change, which would complicate things.

OK, I got it. Thanks