Skip to content

Refactor to use a more traditional CRUD module structure #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Apr 6, 2025

Conversation

chriscarrollsmith
Copy link
Contributor

@chriscarrollsmith chriscarrollsmith commented Mar 14, 2025

  • Router structure is now more traditional for a CRUD app
    • Page routes are now located inside the routers
    • Routers are named for the resources they fetch or modify
    • Future enhancements could use a wider variety of HTTP methods (with HTMX) and more CRUD-like route paths and route handler names
  • Data models have been refactored to support separate public and private schemas (not yet implemented)
    • Account data model is now separate from User, and tokens are related to Account
    • HashedPassword data model has been eliminated
  • New tests verify that url_for functions used in the templates point to legitimate route handlers and that templates render without error
    • Future enhancement: publish a small library to document Jinja2 context programmatically, and also one to enforce consistent regex conversion and behavior from Python to HTML

Closes #77, closes #102, closes #89

@chriscarrollsmith chriscarrollsmith linked an issue Mar 14, 2025 that may be closed by this pull request
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 51 out of 58 changed files in this pull request and generated 1 comment.

Files not reviewed (7)
  • .python-version: Language not supported
  • docs/.gitignore: Language not supported
  • docs/architecture.qmd: Language not supported
  • docs/contributing.qmd: Language not supported
  • docs/customization.qmd: Language not supported
  • docs/templates.qmd: Language not supported
  • index.qmd: Language not supported
Comments suppressed due to low confidence (2)

routers/user.py:22

  • The parameter 'email_update_requested' is defined as a string with a default of "false"; consider using a boolean type for clarity and consistency in the template context.
    email_update_requested: Optional[str] = "false",

.github/workflows/publish.yml:65

  • Switching from appending to $GITHUB_ENV to writing to a custom '_environment' file may affect how environment variables propagate in the CI workflow; please confirm that this change aligns with the intended CI behavior.
          echo "DB_USER=postgres" > _environment

@chriscarrollsmith chriscarrollsmith merged commit cbaff74 into main Apr 6, 2025
2 checks passed
@chriscarrollsmith chriscarrollsmith deleted the 89-use-inheritance-to-define-data-models branch April 6, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test that templates contain no hardcoded routes Use inheritance to define data models Refactor to use a more traditional CRUD module structure
1 participant