Skip to content

New method in router to create CRUD for a Django model.#1712

Open
rroblf01 wants to merge 3 commits into
vitalik:masterfrom
rroblf01:feature/integrate_model_api
Open

New method in router to create CRUD for a Django model.#1712
rroblf01 wants to merge 3 commits into
vitalik:masterfrom
rroblf01:feature/integrate_model_api

Conversation

@rroblf01
Copy link
Copy Markdown

This pull request adds comprehensive documentation for the new auto-generated Model API feature in Django Ninja. The documentation explains how to quickly generate full CRUD endpoints for any Django model using a single method call, details the generated routes and schemas, and describes all available configuration options. It also covers the async variant for projects using Django's async ORM, provides a full example, and compares the auto-generated API to manual CRUD implementations. Additionally, the new documentation page is integrated into the guides navigation.

Documentation for auto-generated Model API:

  • Added a new guide (guides/model-api.md) detailing how to use add_model_api and add_async_model_api to automatically generate CRUD endpoints for Django models, including descriptions of generated endpoints, schemas, parameters (fields, exclude, operations, tags, auth), and usage examples.
  • Explained the difference between sync and async variants, when to use each, and highlighted that both produce identical OpenAPI schemas.
  • Included a side-by-side comparison showing how the auto-generated API replaces manual CRUD endpoint definitions.

Documentation navigation update:

  • Added the new "Auto-generated Model API" guide to the documentation navigation in mkdocs.yml for easy discoverability.

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.

1 participant