[GrandComicsDatabase/gcd-django] Use sortable tables for object selection (PR #750)

1 view
Skip to first unread message

Adam Hernandez

unread,
Sep 1, 2026, 9:06:09 PM (2 days ago) Sep 1
to GrandComicsDatabase/gcd-django, Subscribed

Summary

I routed the database-backed object selector results through the existing sortable django-tables views.

  • Publisher, series, issue, story, and cover searches now use the shared table presentation.
  • Selection actions keep the existing object IDs and downstream handlers.
  • Story selectors retain the separate issue-selection action used by reprints and awards.
  • Cover-only searches use the story table while preserving the existing story selection behavior.
  • Haystack mixed results and the MyComics multi-select flow remain unchanged.

Testing

  • Selector tests: 8 passed
  • Existing story, issue, series, and publisher tests: 118 passed
  • Python compilation and diff checks passed

Closes #675


You can view, comment on, or merge this pull request online at:

  https://github.com/GrandComicsDatabase/gcd-django/pull/750

Commit Summary

  • 8e9494a Use sortable tables for object selection

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/750@github.com>

gemini-code-assist[bot]

unread,
Sep 1, 2026, 9:10:01 PM (2 days ago) Sep 1
to GrandComicsDatabase/gcd-django, Subscribed

@gemini-code-assist[bot] commented on this pull request.

Code Review

This pull request refactors the search selection logic in apps/select/views.py to use Django-tables2-based sortable tables (generic_sortable_list) instead of custom pagination, and adds corresponding unit tests. The feedback suggests simplifying dictionary lookups and ternary expressions in apps/select/views.py using dict.get() with fallbacks to make the code more idiomatic.


In apps/select/views.py:

> +    publisher_name = cd['publisher'] if cd['publisher'] else '?'
+    series_name = cd['series'] if cd.get('series') else ''
+    number = cd['number'] if cd.get('number') else ''
+    year = cd['year'] if cd.get('year') else ''

medium

These dictionary lookups and ternary expressions can be simplified using dict.get() with a fallback. This is cleaner, more idiomatic Python, and avoids redundant dictionary lookups.

⬇️ Suggested change
-    publisher_name = cd['publisher'] if cd['publisher'] else '?'
-    series_name = cd['series'] if cd.get('series') else ''
-    number = cd['number'] if cd.get('number') else ''
-    year = cd['year'] if cd.get('year') else ''
+    publisher_name = cd.get('publisher') or '?'
+    series_name = cd.get('series') or ''
+    number = cd.get('number') or ''
+    year = cd.get('year') or ''
References
  1. Follow idiomatic Python practices (PEP 8 / general best practices) for dictionary access and default values. (link)

In apps/select/views.py:

>        'no_bulk_edit': True,
-      'query_string': request.META['QUERY_STRING'],
       'publisher': cd['publisher'] if cd['publisher'] else '',

medium

This ternary expression can be simplified using dict.get() with a fallback to an empty string.

⬇️ Suggested change
-      'publisher': cd['publisher'] if cd['publisher'] else '',
+      'publisher': cd.get('publisher') or '',
References
  1. Follow idiomatic Python practices (PEP 8 / general best practices) for dictionary access and default values. (link)


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/750/review/5084628849@github.com>

Adam Hernandez

unread,
Sep 1, 2026, 9:19:52 PM (2 days ago) Sep 1
to GrandComicsDatabase/gcd-django, Push

@DeusExTaco pushed 1 commit.

  • 4b87dd3 Simplify selection search defaults


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/750/before/8e9494acfe309c96cb1aa3b13d3c797b79cb07f4/after/4b87dd33e159a64e52d54b5c61be70c85751dde3@github.com>

JochenGCD

unread,
Sep 3, 2026, 5:38:50 AM (yesterday) Sep 3
to GrandComicsDatabase/gcd-django, Subscribed

Merged #750 into beta.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/750/issue_event/30478120436@github.com>

Reply all
Reply to author
Forward
0 new messages