[GrandComicsDatabase/gcd-django] Add api endpoint to get issues on sale on a certain day (PR #700)

3 views
Skip to first unread message

Adam Knights

unread,
Feb 21, 2026, 12:53:52 PM (3 days ago) Feb 21
to GrandComicsDatabase/gcd-django, Subscribed

I could have gone either way between this or /year/{year}/month/{month}/day/{day} i settled on this because it seemed easier that it matches the format of YYYY-MM-DD displayed on the GCD's site. But i could do it the other way if preferred.

This endpoint will help my automation efforts to auto generate variant imports for next week's releases each week.

Tested locally:
image.png (view on web)


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

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

Commit Summary

  • ca8044d Add api endpoint to get issues on sale on a certain day

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/700@github.com>

gemini-code-assist[bot]

unread,
Feb 21, 2026, 12:54:03 PM (3 days ago) Feb 21
to GrandComicsDatabase/gcd-django, Subscribed
gemini-code-assist[bot] left a comment (GrandComicsDatabase/gcd-django#700)

Summary of Changes

Hello @adam-knights, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new API endpoint designed to fetch comic book issues by their on-sale date. This functionality is crucial for streamlining automation processes, such as generating variant imports for upcoming releases, by providing a direct way to query issues based on a specific date.

Highlights

  • New API Endpoint: A new API endpoint /issue/on_sale_date/<str:date>/ has been introduced to retrieve comic book issues based on their on-sale date. The date format expected is YYYY-MM-DD.
  • Date-based Filtering: The new endpoint allows filtering of issues by their on_sale_date field, returning only issues that match the provided date and are not marked as deleted.
  • Automation Support: This endpoint is intended to support automation efforts, specifically for generating variant imports for weekly releases.
Changelog
  • apps/api/urls.py
    • Added a new URL pattern for the IssuesByOnSaleDate view.
  • apps/api/views.py
    • Implemented the IssuesByOnSaleDate class, a ListAPIView that filters Issue objects by on_sale_date.
Activity
  • The author tested the new endpoint locally and provided a screenshot of the successful test results.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.


Reply to this email directly, view it on GitHub, or unsubscribe.

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

gemini-code-assist[bot]

unread,
Feb 21, 2026, 12:56:30 PM (3 days ago) Feb 21
to GrandComicsDatabase/gcd-django, Subscribed

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

Code Review

The pull request successfully introduces a new API endpoint to retrieve issues based on their on-sale date, which is a useful addition for automation. The implementation correctly sets up the URL routing and a ListAPIView with the appropriate serializer. However, it's crucial to add robust validation for the date parameter to ensure data integrity and provide clear error feedback to API consumers.


In apps/api/views.py:

> +        date = self.kwargs['date']
+        return Issue.objects.filter(on_sale_date=date,
+                                    deleted=False)

high

The date parameter from the URL is directly used in the Issue.objects.filter query without any validation. If an invalid date string (e.g., '2023-13-01' or 'not-a-date') is provided, it could lead to unexpected query results or potential errors. It's critical to validate the input date format to ensure data integrity and provide a clear error message to the API consumer. You will also need to add import datetime and from rest_framework.exceptions import ValidationError to the top of the file.

⬇️ Suggested change
-        date = self.kwargs['date']
-        return Issue.objects.filter(on_sale_date=date,
-                                    deleted=False)
+        date_param = self.kwargs['date']
+        try:
+            # Validate the date string format
+            datetime.datetime.strptime(date_param, '%Y-%m-%d')
+        except ValueError:
+            raise ValidationError("Invalid date format. Please use YYYY-MM-DD.")
+
+        return Issue.objects.filter(on_sale_date=date_param,
+                                    deleted=False)

In apps/api/urls.py:

> +    path('issue/on_sale_date/<str:date>/',
+         views.IssuesByOnSaleDate.as_view()),

medium

The <str:date> path converter is very generic. While the view's docstring specifies YYYY-MM-DD, the URL pattern itself doesn't enforce this. It's good practice to make URL patterns as specific as possible. Although the primary validation will occur in the view, a more restrictive path converter (e.g., using a regex) could provide earlier feedback for malformed URLs.


Reply to this email directly, view it on GitHub, or unsubscribe.

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

Adam Knights

unread,
Feb 21, 2026, 12:58:15 PM (3 days ago) Feb 21
to GrandComicsDatabase/gcd-django, Subscribed
adam-knights left a comment (GrandComicsDatabase/gcd-django#700)

Let me know if you want me to do either or both of those suggestions, i'll wait and see if the url pattern is ok with you first.


Reply to this email directly, view it on GitHub, or unsubscribe.

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

Brian Pepple

unread,
Feb 21, 2026, 1:25:26 PM (3 days ago) Feb 21
to gcd-...@googlegroups.com
On 2/21/26 12:53 PM, 'Adam Knights' via gcd-tech wrote:

I could have gone either way between this or /year/{year}/month/{month}/day/{day} i settled on this because it seemed easier that it matches the format of YYYY-MM-DD displayed on the GCD's site. But i could do it the other way if preferred.

This endpoint will help my automation efforts to auto generate variant imports for next week's releases each week.

Tested locally:
image.png (view on web)


Hi,

Saw this and was wondering if you've (GCD) given any thought about using drf + django-filters (or some comparable package) to handle parameters instead of using url-based parameters? I've found it to be much more flexible. For example, for my issue list endpoint I use the following filters(1), which if I were to try to replicate using url-based parameters would a significant amount of work to get comparable results.

Anyway, just thought I'd inquire, since your API is still (relatively) new.

1) https://github.com/Metron-Project/metron/blob/c98320dd0415a726ef69597d1984e220002ce5c4/comicsdb/filters/issue.py#L20

-- 
Brian Pepple <bpe...@metron.cloud>

https://about.me/brian.pepple
OpenPGP_0x2BA2D65FF62FBA56.asc
OpenPGP_signature.asc

JochenGCD

unread,
Feb 21, 2026, 2:07:55 PM (3 days ago) Feb 21
to GrandComicsDatabase/gcd-django, Subscribed
jochengcd left a comment (GrandComicsDatabase/gcd-django#700)

I wonder if instead of daily we should provide weekly, as does the site ?

How to handle incomplete, e.g. just year and month, or just even year, in the API ?


Reply to this email directly, view it on GitHub, or unsubscribe.

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

Jochen G.

unread,
Feb 21, 2026, 2:25:13 PM (3 days ago) Feb 21
to gcd-...@googlegroups.com
I saw the option, and since we use django-filter otherwise in the site,
we should definetely investigate.

But, if we allow more generic searches on issues, we also need to
investigate pagination or limits on the response size. How do you handle
that ?

Jochen

On 2/21/26 19:25, Brian Pepple wrote:
> Saw this and was wondering if you've (GCD) given any thought about using
> drf + django-filters (or some comparable package) to handle parameters
> instead of using url-based parameters? I've found it to be much more
> flexible. For example, for my issue list endpoint I use the following
> filters(1), which if I were to try to replicate using url-based
> parameters would a significant amount of work to get comparable results.
>
> Anyway, just thought I'd inquire, since your API is still (relatively) new.
>
> 1) https://github.com/Metron-Project/metron/blob/
> c98320dd0415a726ef69597d1984e220002ce5c4/comicsdb/filters/issue.py#L20
>
> --
> Brian Pepple<bpe...@metron.cloud>
>
> https://about.me/brian.pepple
>
> --
> You received this message because you are subscribed to the Google
> Groups "gcd-tech" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to gcd-tech+u...@googlegroups.com <mailto:gcd-
> tech+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/gcd-
> tech/406e4266-f0a0-4225-89ba-83aa23257b3b%40metron.cloud <https://
> groups.google.com/d/msgid/gcd-tech/406e4266-
> f0a0-4225-89ba-83aa23257b3b%40metron.cloud?
> utm_medium=email&utm_source=footer>.

Adam Knights

unread,
Feb 21, 2026, 2:42:43 PM (3 days ago) Feb 21
to GrandComicsDatabase/gcd-django, Subscribed
adam-knights left a comment (GrandComicsDatabase/gcd-django#700)

I did not know we had that :)

Yeah, i could change it to /api/on_sale_weekly/{year}/week/{weekNumber}/ to match

I had to look at how we do it, but i see its the ISO 8601 week date system, so i could re-use the 4th Jan trick / code in do_on_sale_weekly?


Reply to this email directly, view it on GitHub, or unsubscribe.

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

Adam Knights

unread,
Feb 21, 2026, 2:44:17 PM (3 days ago) Feb 21
to GrandComicsDatabase/gcd-django, Subscribed
adam-knights left a comment (GrandComicsDatabase/gcd-django#700)

or /api/issue/on_sale_weekly/{year}/week/{weekNumber}/ ?


Reply to this email directly, view it on GitHub, or unsubscribe.

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

Brian Pepple

unread,
Feb 21, 2026, 3:24:36 PM (3 days ago) Feb 21
to 'Jochen G.' via gcd-tech
On 2/21/26 2:25 PM, 'Jochen G.' via gcd-tech wrote:
I saw the option, and since we use django-filter otherwise in the site, we should definetely investigate.

But, if we allow more generic searches on issues, we also need to investigate pagination or limits on the response size. How do you handle that ?

I believe you already have pagination, I think it's maybe 50 or 100 items, for the list views. It's the "PAGE_SIZE" value in the REST_FRAMEWORK settings. Ideally, depending what filters you offered it should substantially reduce the results in the API response. For example, I use your API to get the gcd issue id's using the following:

/api/series/name/Batman/issue/1/

Ideally, it would be nice to be able to do a query like this (or something similar) which should give only 1 result (providing it exists):

/api/issue/?series_id=1&number=1

Given the size of your DB being able to filter on things like country, publisher, years, etc, should help with the response sizes. If you'd like to see how I've implemented it, you can find the code here:

https://github.com/Metron-Project/metron/tree/master/api

If you've got any questions, don't hesitate to ask.


Take care,

/B

OpenPGP_0x2BA2D65FF62FBA56.asc
OpenPGP_signature.asc

Adam Knights

unread,
Feb 22, 2026, 4:05:17 AM (3 days ago) Feb 22
to GrandComicsDatabase/gcd-django, Push

@adam-knights pushed 1 commit.

  • 7a536f2 Add api endpoint to get issues of a week in a year


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/700/before/ca8044d71a7d62d2ee97f25fc3218c3b342c376d/after/7a536f250fbbbbc8a98785b56ee07cb6e004401d@github.com>

Adam Knights

unread,
Feb 22, 2026, 4:07:43 AM (3 days ago) Feb 22
to GrandComicsDatabase/gcd-django, Push

@adam-knights pushed 1 commit.

  • fef1367 Add api endpoint to get issues of a week in a year


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/700/before/7a536f250fbbbbc8a98785b56ee07cb6e004401d/after/fef13671f37b660b91d3cebb4179a9aeaf7e4ab1@github.com>

Reply all
Reply to author
Forward
0 new messages