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

Make process table sortable #56

Merged
merged 2 commits into from
Sep 10, 2024
Merged

Make process table sortable #56

merged 2 commits into from
Sep 10, 2024

Conversation

cc-a
Copy link
Contributor

@cc-a cc-a commented Sep 10, 2024

Description

Adds the view function logic to make the process table on the index page sortable. You can now click the header of each column to sort by its contents.

Fixes #42

Type of change

  • Documentation (non-breaking change that adds or improves the documentation)
  • New feature (non-breaking change which adds functionality)
  • Optimization (non-breaking, back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Key checklist

  • All tests pass (eg. python -m pytest)
  • The documentation builds and looks OK (eg. python -m sphinx -b html docs docs/build)
  • Pre-commit hooks run successfully (eg. pre-commit run --all-files)

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added or an issue has been opened to tackle that in the future. (Indicate issue here: # (issue))

Copy link
Collaborator

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work, but absolutely nothing in the code seems to suggest that by doing this the table becomes sortable. Might be worth adding a comment somewhere indicating why we are doing what we are doing...

Copy link
Contributor

@AdrianDAlessandro AdrianDAlessandro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second what Diego said, a comment to explain what this line is doing would be nice.

Is this necessary because we're manually building the table with a list and dict instead of via database models and the provided generic views in django-tables2?

@cc-a
Copy link
Contributor Author

cc-a commented Sep 10, 2024

Is this necessary because we're manually building the table with a list and dict instead of via database models and the provided generic views in django-tables2?

No, it's just the way that django tables 2 handles things like sorting and pagination. There are get parameters included in the request that it processes and uses to sort contents of the table.

@cc-a cc-a enabled auto-merge September 10, 2024 14:18
@cc-a cc-a merged commit 7809a94 into main Sep 10, 2024
4 checks passed
@cc-a cc-a deleted the table-sorting branch September 10, 2024 14:20
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

Successfully merging this pull request may close these issues.

Enable table sorting
3 participants