Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: How to change sort order on /speeches/ #329

Closed
jpmckinney opened this issue Jul 7, 2014 · 2 comments
Closed

Docs: How to change sort order on /speeches/ #329

jpmckinney opened this issue Jul 7, 2014 · 2 comments

Comments

@jpmckinney
Copy link
Contributor

It seems to default to sorting by ID, which I guess works if you import in chronological order and if you want top-level sections to appear chronologically. (I'd rather my sort order not depend on my import order, though.)

However, when it comes to transcripts from a body that is continuously publishing (like any legislature), you usually want reverse-chronological order. (I guess you can override the template with {% for obj in object_list reversed %}, but again this will only work if the import order is chronological.)

Is there no alternative to creating my own view?

@dracos
Copy link
Member

dracos commented Jul 7, 2014

/speeches is a special case page compared to a section page (which lists one section's speeches and its descendant sections, trying its best to sort by ascending time). As you say, /speeches just displays Sections that don't have a parent, in ID order, which isn't great.

Being able to sort sections differently is #16. A Section containing a debate/subdebates you'd want to be ordered by time, but a Section containing the days' debates (and/or this top level, depending on how your content is organised) you might well want reversed, as you say. Or a calendar, that's #103.

As a simple first step, the default ordering of /speeches being reversed would be slightly better in the normal case, and at least then gives you "most recently created", if not "most recent date of data" or "most recent with new content". A next step could use a variant of the section page recursive SQL code to at least sort the /speeches page in the same way subsections are sorted on a section page, when timestamped data is available.

You don't want to be constrained by import order, indeed, and the above could be enough for timestamped data, but not untimestamped or other ways of displaying, for which you would need some form of manual sort ordering.

@jpmckinney
Copy link
Contributor Author

#16 and #135 seem to cover the same as this issue. Closing in favor of those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants