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.

Scheduled publishing fields

See original GitHub issue

The scheduled publishing fields are a bit unintuitive and their names are a bit inconsistent with the terminology we use elsewhere in wagtail.

More specifically: (try and answer these questions without looking at the code)

  • We have two go_live_at fields. One on Page and one on PageRevision. What is the difference between these?
  • go_live means publish and expire means unpublish. Why did we make up these new words?
  • We don’t publish pages, we publish revisions. So what does Page.go_live_at actually do? Which revision will it publish?

Heres what I propose:

  • Remove Page.go_live_at
  • Rename Page.expire_at to Page.unpublish_at
  • Rename PageRevision.approved_go_live_at to PageRevision.publish_after (named “after” instead of “at” as publishing entirely depends on whether it’s in moderation or not)

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
ababiccommented, Mar 17, 2016

Hi guys. While on this subject… I’ve ran into a few situations where I’ve needed to pull out a list of ‘latest’ things onto a homepage. Those things could have been recently published for the first time, or recently updated.

In other plain Django and other Django-based CMSs I’ve used, this would always be solved by having a last_updated DateTimeField with auto_now=True, but in Wagtail, the revisions process complicates things a little. It seems that the first_published_at field is readily available on the Page, but a last updated at field isn’t. There’s last_revision_created_at, but that’s not quite the same thing, because for the front end, that date isn’t relevant… it’s the date the latest revision was ‘published’ that is relevant.

I know that, technically, I can work that date out by accessing the Pages revisions, but then, the Revision.approved_go_live_at date is what I really need, but that’s always NULL unless the publishing was delayed, so I’ve got to get that OR the Revision.created_at (I think), OR resort to Page.latest_revision_created_at?

So, essentially, what would normally just be Page.objects.all().order_by('-last_updated') is a very complicated set of queries and sub-queries.

What would be really nice is a last_revision_published_at DateTime field on the Page model, that would represent when the page was last ‘publicly’ updated. Is is possible for that to be reliably populated?

0reactions
lacymorrowcommented, Apr 9, 2019

Here’s a reference from the source code, I couldn’t find real docs: https://github.com/wagtail/wagtail/blob/master/wagtail/core/models.py#L251

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scheduled Publishing - Hygraph
Hygraph gives you the ability to schedule content publishing, and unpublishing as one off, or as a collection (referred to as a "release")....
Read more >
Scheduled publishing | Contentful Help Center
Schedule an entry to be published or unpublish at a certain time and date. Create multiple scheduled actions on an entry at different...
Read more >
Automate Publishing with Wordpress Scheduled Posts
Automating content publishing on WordPress can save you significant time. Learn about WordPress scheduled posts and eliminate manual tasks.
Read more >
Scheduling pages for publishing | Kentico 11 Documentation
If time zones are enabled, the day and time values in the Publish from/Publish to fields are displayed in a format relative to...
Read more >
How to schedule post publishing in WordPress - A2 Hosting
Scheduling the publishing date and time for a post ... To schedule when WordPress publishes a new post, follow these steps: ... Click...
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