orf / simple

Simple is a clone of Obtvse written in Python running on Flask.
MIT License
505 stars 280 forks source link

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

Closed yin8086 closed 11 years ago

yin8086 commented 11 years ago

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 11 years ago

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.

yin8086 commented 11 years ago

OK, I got it. Thanks