I routed the database-backed object selector results through the existing sortable django-tables views.
Closes #675
https://github.com/GrandComicsDatabase/gcd-django/pull/750
(3 files)
—
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.![]()
@gemini-code-assist[bot] commented on this pull request.
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.
> + 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 ''
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.
- 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
> 'no_bulk_edit': True,
- 'query_string': request.META['QUERY_STRING'],
'publisher': cd['publisher'] if cd['publisher'] else '',
This ternary expression can be simplified using dict.get() with a fallback to an empty string.
- 'publisher': cd['publisher'] if cd['publisher'] else '',
+ 'publisher': cd.get('publisher') or '',
References
—
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.![]()
@DeusExTaco pushed 1 commit.
—
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.![]()
—
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.![]()