How dabapps/django-readers works
Main components
• Client / User
• Django HTTP layer
– (Standard Django Views) or (Django REST Framework ViewSets)
• django_readers library
– specs.py (Specification functions)
– qs.py (QuerySet helpers)
– producers.py (Data‑producing callables)
– projectors.py (Projection callables / mappers)
– pairs.py (Convenience wrappers for producer+projector)
– rest_framework.py (DRF integration utilities)
– utils.py (Auxiliary helpers)
• Django ORM & Model layer
• Relational Database
Relationships & data flow
1. User issues HTTP request (browser or API client).
2. Request hits a Django view or DRF ViewSet.
3. View/ViewSet uses django_readers.specs to build filter/spec definitions.
4. View then invokes django_readers.qs helpers and producers to construct or filter a QuerySet.
5. The ORM translates QuerySet into SQL; the database returns result rows.
7. If using DRF, rest_framework.py adapters help hook projector output into DRF Response/Serializer pipelines.
8. The view returns an HTTP response to the client.
Architectural patterns & design principles
• Function‑oriented, composable “producers” define how you fetch/filter data.
• “Specs” implement Specification pattern for business rules / filters.
• “Pairs” combine producers + projectors for single‑call operations.
• Light integration layer for Django REST Framework to avoid boilerplate.
• Separation of concerns: query construction, filtering, projection, and API integration are each in their own module.