GeneralManager
GeneralManager is a typed, declarative framework for building data-rich Django applications. Define domain objects once, then use the same model through the Django ORM, generated GraphQL, permission policies, validation, calculations, search, and workflows.
GeneralManager is pre-1.0. The main branch and latest PyPI release can differ;
use the release history
to distinguish published behavior from current development.
What GeneralManager provides
Domain models and interfaces
- Generate Django-backed models from typed manager definitions.
- Wrap existing Django models or expose calculated, request-backed, and remote data through the same manager API.
Start with the architecture overview and interface concepts.
APIs, permissions, and validation
- Generate GraphQL queries, mutations, subscriptions, filters, and pagination.
- Apply manager-, operation-, object-, and field-level permission policies.
- Keep business validation close to the domain with declarative rules.
Data and operations
- Work with unit- and currency-aware measurements and dataframe conversion helpers.
- Coordinate derived values with dependency-aware caching, search, workflows, audit logging, and metrics.
Development and optional integrations
- Seed realistic data with generated factories and manager-landscape helpers.
- Opt into secure GraphQL file uploads and provider-based LLM chat when those subsystems fit the application.
Compatibility
- Python 3.12 or later
- Django 5.2.15 or later
CI tests Python 3.12, 3.13, and 3.14 against SQLite, PostgreSQL and MariaDB.
Other database backends supported by Django may also work, but are not officially supported unless covered by GeneralManager’s test suite or maintained examples.
Five-minute setup
Start in an empty directory. On macOS or Linux:
mkdir general-manager-demo
cd general-manager-demo
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install GeneralManager
django-admin startproject gm_demo .
python manage.py startapp projects
Append the following to gm_demo/settings.py:
INSTALLED_APPS += [
"general_manager",
"projects.apps.ProjectsConfig",
]
AUTOCREATE_GRAPHQL = True
GRAPHQL_URL = "graphql/"
ALLOWED_HOSTS = ["127.0.0.1", "localhost", "testserver"]
Create projects/managers.py:
from typing import ClassVar
from django.db.models import CharField
from general_manager import GeneralManager
from general_manager.interface import DatabaseInterface
from general_manager.permission import AdditiveManagerPermission
class Project(GeneralManager):
name: str
class Interface(DatabaseInterface):
name = CharField(max_length=100)
class Permission(AdditiveManagerPermission):
__read__: ClassVar[list[str]] = ["public"]
__create__: ClassVar[list[str]] = ["isAuthenticated"]
__update__: ClassVar[list[str]] = ["isAuthenticated"]
__delete__: ClassVar[list[str]] = ["isAuthenticated"]
GeneralManager discovers managers.py modules in installed Django applications
during startup, so no manual import in AppConfig.ready() is needed. Create the
generated model's migration, initialize the database, and seed one demo record:
python manage.py makemigrations projects
python manage.py migrate
python manage.py shell -c 'from projects.managers import Project; Project.Factory.create(name="Apollo")'
python manage.py runserver
Project.Factory.create(...) is intended here for demo seeding. Application
writes should run through an authenticated permission context.
In another terminal, retrieve the record through generated GraphQL. This GET request is copyable without a CSRF token:
curl --get 'http://127.0.0.1:8000/graphql/' \
--data-urlencode 'query=query { projectList { items { name } } }'
Expected response:
{"data":{"projectList":{"items":[{"name":"Apollo"}]}}}
You now have a typed manager, generated Django model, migration, persisted record, permission policy, and generated GraphQL query. Continue with the annotated quickstart for Windows activation, framework behavior, and troubleshooting.
Documentation
- Documentation home
- Quickstart
- Installation and optional extras
- Concept guides
- API reference
- Examples and recipes
Project links
Metadata
Release files for GeneralManager 0.81.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| generalmanager-0.81.2.tar.gz | 913.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| generalmanager-0.81.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.0 MB
Release files / generalmanager-0.81.2.tar.gz
| Download URL | generalmanager-0.81.2.tar.gz |
|---|---|
| Size | 913.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
667ccb39b3724429e134e2086fac38cf4fb4322987f88d47894e635d9ee52d6b
|
|
BLAKE2b-256 checksum How to use checksums |
caafee7bf15a7a4bc0d94bf5f00b78efee7ac44cdb476647c06e54d71786c0f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.14
|
Release files / generalmanager-0.81.2-py3-none-any.whl
| Download URL | generalmanager-0.81.2-py3-none-any.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4913c0ba349066f228b51a33049293f7ed66cc5aae3cf624092d2836dd55b1f9
|
|
BLAKE2b-256 checksum How to use checksums |
51a2039cfcffda863568939218cdfefe42e0805004e8da6ace2f44385ef9c480
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.14
|