Repository navigation
Conversation
# Conflicts: # requirements.txt
INSTALLED_APPS/MIDDLEWARE don't include django.contrib.auth or django.contrib.messages, so referencing their context processors would raise once a test renders a template via RequestContext.
Django 5.2 needs Python 3.10+; without python_requires, installing on an older interpreter fails with a confusing dependency-resolution error instead of a clear version message.
Django 5.2.12 officially supports both per PyPI classifiers, and the test suite passes locally under 3.13 and 3.14.
Adds example/, a small Django project (Book/Books, matching the top-level README) that can actually be migrated and served, rather than only exercised through the test runner. Verified via runserver + browser that createviewtable produces a queryable, aggregated view. Along the way this surfaced a real gotcha: a ViewTable subclass keeps Django's implicit auto "id" field by default, but get_query() doesn't select an id column, so any query touching the default fields (not just .values_list()) raises OperationalError. The example works around it by making category the primary key.
Existing tests only exercise get_query() built through the Django ORM query builder. Real-world usage (per user report) tends to hand-write SQL with several joins instead, so this adds a case that mirrors that: get_query() returns a plain SQL string joining three tables (INNER + LEFT JOIN) with a GROUP BY, and a ROW_NUMBER()-synthesized id column to satisfy Django's implicit primary key expectation. Verified on Python 3.10-3.14 / their bundled sqlite3 (window function support).
Extends the example app with Author/Publisher models and AuthorPublisherSummary, a view_table backed by a hand-written SQL string (not the ORM query builder) joining three tables with INNER + LEFT JOIN and GROUP BY -- mirroring how the library is actually used in production, per user report. The LEFT JOIN case (a book with no publisher on record) is deliberately included in the seed data and renders as "(none)" on the page. Verified via runserver + browser, and via a clean pip install -e . environment.
Nothing in the repo references it (no README mention, no CI usage), and the example app under example/ now covers manual verification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.