Ferrobase Package Overview¶
See the full API at ferrosoft.apps.ferrobase package.
Modules¶
appsDjango application configuration, menu registration types, and platform app metadata.
consumersDjango Channels WebSocket consumers for real-time frontend UI updates.
containerscontextASGI lifespan context managers for shared HTTP client lifecycle.
context_processorsDjango template context processors for ferrobase.
encodingsCharacter-encoding detection and the catalogue of supported text encodings.
filterDjango-filter
FilterSetdefinitions for ferrobase models.frontendPrimitives for pushing real-time UI updates over WebSocket to the frontend.
Provides a hierarchy of serialisable element types (
Element,UpdateSpec, etc.) andFrontendUIUpdater, which broadcasts update specs to a Django Channels channel group so connected clients can apply them without a full page reload.templatingUtilities for rendering Django templates from raw strings.
urlsURL configuration for the ferrobase application.
Subpackages¶
ferrobase.api¶
Detail page: ferrosoft.apps.ferrobase.api package.
ferrobase.auth¶
Detail page: ferrosoft.apps.ferrobase.auth package.
ferrobase.forms¶
Detail page: ferrosoft.apps.ferrobase.forms package.
ferrobase.management¶
Detail page: ferrosoft.apps.ferrobase.management package.
ferrobase.middleware¶
Detail page: ferrosoft.apps.ferrobase.middleware package.
ferrobase.models¶
Detail page: ferrosoft.apps.ferrobase.models package.
ferrobase.services¶
Detail page: ferrosoft.apps.ferrobase.services package.
captchaLightweight image-based CAPTCHA used on public forms.
Generates a small arithmetic puzzle, renders it as a PNG, and stores the expected answer in the session for later verification.
cleanupconversionScientific unit conversion and normalisation.
Provides direct unit-to-unit conversion via the
MULTIPLIERSlookup table and category-based normalisation viaNORMALIZED_UNITS. All arithmetic is done withdecimal.Decimaland quantised toPRECISIONto absorb precision loss introduced by Django ORM fields.helpidgeneratoronboardingsseServer Side Events (SSE) client for Python.
Provides a generator of SSE received through an existing HTTP response.
static_filestaskqueuetenant_mgmTenant provisioning: PostgreSQL role/database creation, migrations and fixtures.
updateuser_mgmzitadelHTTP REST client and request/response dataclasses for the ZITADEL IAM API v2.
ferrobase.session¶
Detail page: ferrosoft.apps.ferrobase.session package.
formspassword_resetPassword reset email dispatch using templated messages.
ferrobase.tables¶
Detail page: ferrosoft.apps.ferrobase.tables package.
columnsReusable django-tables2 column classes for Ferrosoft tables.
The columns add rendering for domain-specific values (currency, units, dates, arrays, inline-edit widgets) as well as layout helpers (fixed-width classes, summing footers, action links) on top of django-tables2’s base
Column.crudmodelstable
ferrobase.tenant¶
Detail page: ferrosoft.apps.ferrobase.tenant package.
contextContext-variable storage for the currently active tenant.
Multi-tenancy is propagated through a single
ContextVarso that both threaded and asynchronous request handling pick up the correct tenant without any explicit argument passing. ORM helpers inferrosoft.apps.ferrobase.tenant.utilsconsult this variable to pick the right database alias.formstablesutils
ferrobase.views¶
Detail page: ferrosoft.apps.ferrobase.views package.
api_tokenbasecompany_sitefilesgenericGeneric views defining a gold standard for Ferrosoft Platform.
Currently, these generic views revolve around CRUD for models. They spice up generic views found in Django, django-filter and django_tables2.
To make use of it, define subclasses for each CRUD verb to be supported:
Define a CreateView to create instances of a model class.
Define a UpdateView to update instances of a model class.
Define a DeleteView to delete instances of a model class.
- Define one of the read views to read display instances of a model class:
Define a TableView to display a table along with filters.
Define a FilterView to display a list along with filters.
Define a ListView to display a list without filters.
In the same module where the subclasses are defined, call model_crud_routes to generate a list of URL patterns, which can be used in the app’s url module.
Example
class MaterialCreateView(generic.CreateView):
fields = [“code”, “name”] model = Material
class MaterialListView(generic.FilterView):
filterset_class = MaterialFilterSet model = Material ordering = “code”
class MaterialUpdateView(generic.UpdateView):
fields = [“code”, “name”] model = Material
class MaterialDeleteView(generic.DeleteView):
model = Material
- material_urls = generic.model_crud_routes(
Material, create_view=MaterialCreateView, read_view=MaterialListView, update_view=MaterialUpdateView, delete_view=MaterialDeleteView,
)
groupViews for group management. Groups are used in the Django permission system.
indexmaterialmediaonboardingorganizationpartnerpasswordsessionsettingstenantuser