question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pages need a "created_at"/"first_published_at" for rapid query/ordering purposes

See original GitHub issue

Similar to #577. Sometimes you need to filter pages of a type and order them by descending date, as a crude way to feature the most fresh content first.

When the date of creation is something you want the public to know/see e.g a blog posts or a press releases, dates warrant a field of their own in your custom model, but most of the time you just need an approximate measurement of freshness to use procedurally in the background, and don’t want to have to add a field to store it.

I’d like a “created at”, and also a “first published at”, because the date of creation could with some workflows be far from the date of publication.

(The existing latest_revision isn’t useful here because you don’t want old pages appearing first after receiving a minor grammatical tweak.)

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
nadersolimancommented, Aug 31, 2016

first_published_at is implemented with editable=False and as such cannot be added as a UI field in any page editing tab, so why the decision of editable=False in first place?

0reactions
chrxrcommented, Mar 31, 2015

Merged in https://github.com/torchbox/wagtail/pull/1054. Opened new ticket for UI implementation discussion https://github.com/torchbox/wagtail/issues/1126.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Questionable SQL practice - Order By id rather than creation ...
The basic summary is the first solution, ordering by created_at, is considered best practice. Be sure, however, to properly index the created_at ......
Read more >
Efficient `IN` operator queries - GitLab Docs
This document describes a technique for building efficient ordered database queries with the IN SQL operator and the usage of a GitLab utility...
Read more >
MySQL - UUID/created_at cursor based pagination?
SELECT some_columns FROM users WHERE (created_at, uuid) < (x, y) ORDER BY created_at DESC;. uuid is only needed because created_at is not unique ......
Read more >
Pagination | Docs | Twitter Developer Platform
Pagination refers to methods for programatically requesting all of the pages, in order to retrieve the entire result data set. Not all API...
Read more >
How To Order Query Results in Laravel Eloquent - DigitalOcean
Both the created_at and the updated_at fields are managed by Eloquent when you include a timestamps() definition in your table migration. You ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found