[GrandComicsDatabase/gcd-django] Character ordering (PR #741)

2 views
Skip to first unread message

JochenGCD

unread,
Aug 13, 2026, 4:43:17 PM (9 hours ago) Aug 13
to GrandComicsDatabase/gcd-django, Subscribed

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

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

Commit Summary

  • 308b172 add multiple feature names
  • 65bb0d4 display for feature names
  • 5bedca8 feature name display changes
  • ab2c71d feature logo updates
  • debf7fa filter_issues does the filter, add feature logo with feature
  • a06c5cc filter_issues does the filter
  • ad2536e remove feature_object from editing
  • c90086f fix feature logo list for feature
  • dcc502e remove feature_object from editing logos
  • c9c0679 copy
  • 497bd6a Merge remote-tracking branch 'origin' into character-ordering
  • 2cdd4be add feature description

File Changes

(24 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/741@github.com>

gemini-code-assist[bot]

unread,
Aug 13, 2026, 4:46:04 PM (9 hours ago) Aug 13
to GrandComicsDatabase/gcd-django, Subscribed

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

Code Review

This pull request introduces support for multiple feature names by adding the FeatureNameDetail model and its revision counterpart, updating references across stories, logos, views, and forms. The review feedback identifies several critical issues, including the use of deprecated urlresolvers which will fail in Django 5.x, a potential AttributeError in FeatureNameDetailRevision due to a missing sort_name attribute, a missing import of Formset in the feature forms, and an optimization opportunity to avoid a redundant database query in feature_logo_feature_issues.


In apps/gcd/models/feature.py:

> +    def get_absolute_url(self):
+        return urlresolvers.reverse(
+                'show_feature',
+                kwargs={'feature_id': self.feature.id})

high

In Django 2.0+, django.core.urlresolvers was removed in favor of django.urls. Using urlresolvers.reverse will raise a NameError or ImportError in Django 5.x. Please import and use reverse from django.urls instead.

⬇️ Suggested change
-    def get_absolute_url(self):
-        return urlresolvers.reverse(
-                'show_feature',
-                kwargs={'feature_id': self.feature.id})
+    def get_absolute_url(self):
+        from django.urls import reverse
+        return reverse(
+                'show_feature',
+                kwargs={'feature_id': self.feature.id})

In apps/gcd/models/feature.py:

> +    def render_issue_count(self, record):
+        url = urlresolvers.reverse(
+            'feature_logo_feature_issues',
+            kwargs={'feature_id': self.feature_id,
+                    'feature_logo_id': record.id})
+        return mark_safe('<a href="%s">%s</a>' % (url,
+                                                  record.issue_count))

high

Similar to get_absolute_url, urlresolvers.reverse should be replaced with django.urls.reverse to ensure compatibility with Django 5.x.

⬇️ Suggested change
-    def render_issue_count(self, record):
-        url = urlresolvers.reverse(
-            'feature_logo_feature_issues',
-            kwargs={'feature_id': self.feature_id,
-                    'feature_logo_id': record.id})
-        return mark_safe('<a href="%s">%s</a>' % (url,
-                                                  record.issue_count))
+    def render_issue_count(self, record):
+        from django.urls import reverse
+        url = reverse(
+            'feature_logo_feature_issues',
+            kwargs={'feature_id': self.feature_id,
+                    'feature_logo_id': record.id})
+        return mark_safe('<a href="%s">%s</a>' % (url,
+                                                  record.issue_count))

In apps/oi/models.py:

> +    def _imps_for(self, field_name):
+        if field_name == 'sort_name':
+            if self.sort_name == self.name:
+                return 0
+            else:
+                return 1

high

FeatureNameDetailRevision does not have a sort_name attribute, so accessing self.sort_name will raise an AttributeError. Instead, you can compute the sort name based on self.name and self.leading_article using remove_leading_article if leading_article is True.

⬇️ Suggested change
-    def _imps_for(self, field_name):
-        if field_name == 'sort_name':
-            if self.sort_name == self.name:
-                return 0
-            else:
-                return 1
+    def _imps_for(self, field_name):
+        if field_name == 'sort_name':
+            sort_name = remove_leading_article(self.name) if self.leading_article else self.name
+            if sort_name == self.name:
+                return 0
+            else:
+                return 1

In apps/oi/forms/feature.py:

> +from .support import (KeywordBaseForm, FEATURE_HELP_LINKS, HiddenInputWithHelp,
                       _get_comments_form_field, combine_reverse_relations,
                       GENERIC_ERROR_MESSAGE, _create_embedded_image_revision,
                       _save_runtime_embedded_image_revision)

high

Formset is used in the layout of FeatureRevisionForm but is not imported in this file, which will cause a NameError at runtime. Please import Formset from .support.

⬇️ Suggested change
-from .support import (KeywordBaseForm, FEATURE_HELP_LINKS, HiddenInputWithHelp,
-                      _get_comments_form_field, combine_reverse_relations,
-                      GENERIC_ERROR_MESSAGE, _create_embedded_image_revision,
-                      _save_runtime_embedded_image_revision)
+from .support import (KeywordBaseForm, FEATURE_HELP_LINKS, HiddenInputWithHelp,
+                      _get_comments_form_field, combine_reverse_relations,
+                      GENERIC_ERROR_MESSAGE, _create_embedded_image_revision,
+                      _save_runtime_embedded_image_revision, Formset)

In apps/gcd/views/details.py:

>          'heading': 'for feature logo %s' % (feature_logo)
     }
     template = 'gcd/search/tw_list_sortable.html'
-    table = IssueTable(issues,
-                       attrs={'class': 'sortable_listing'},
-                       template_name=TW_SORT_TABLE_TEMPLATE,
-                       order_by=('publication_date'))
+    table = _table_issues_list_or_grid(request, issues, context)
+    return generic_sortable_list(request, issues, table, template, context)
+
+
+def feature_logo_feature_issues(request, feature_logo_id, feature_id):
+    feature_logo = get_gcd_object(FeatureLogo, feature_logo_id)
+    feature = get_gcd_object(Feature, feature_id)
+
+    if feature_logo.feature.all()[0].feature_type.id == 1:

medium

Since the feature object is already retrieved and passed into this function, you can directly access feature.feature_type.id instead of performing an unnecessary database query and list indexing with feature_logo.feature.all()[0].feature_type.id. This is both more efficient and safer (avoids potential IndexError).

⬇️ Suggested change
-    if feature_logo.feature.all()[0].feature_type.id == 1:
+    if feature.feature_type.id == 1:


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/741/review/4931440650@github.com>

JochenGCD

unread,
Aug 13, 2026, 4:49:50 PM (9 hours ago) Aug 13
to GrandComicsDatabase/gcd-django, Push

@jochengcd pushed 1 commit.

  • 30a62e1 Apply suggestion from @gemini-code-assist[bot]


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/741/before/2cdd4be394bf42ae768a6b2c9c549d2afcfa5f22/after/30a62e1ac328232385c678655cde20011719a2b9@github.com>

JochenGCD

unread,
Aug 13, 2026, 4:54:37 PM (9 hours ago) Aug 13
to GrandComicsDatabase/gcd-django, Subscribed

@jochengcd commented on this pull request.


In apps/gcd/models/feature.py:

> +    def get_absolute_url(self):
+        return urlresolvers.reverse(
+                'show_feature',
+                kwargs={'feature_id': self.feature.id})

import django.urls as urlresolvers


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/741/review/4931506822@github.com>

JochenGCD

unread,
Aug 13, 2026, 5:01:03 PM (9 hours ago) Aug 13
to GrandComicsDatabase/gcd-django, Subscribed

Merged #741 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/741/issue_event/29424857681@github.com>

Reply all
Reply to author
Forward
0 new messages