Ferrobase Package Overview

See the full API at ferrosoft.apps.ferrobase package.

Modules

apps

Django application configuration, menu registration types, and platform app metadata.

consumers

Django Channels WebSocket consumers for real-time frontend UI updates.

containers
context

ASGI lifespan context managers for shared HTTP client lifecycle.

context_processors

Django template context processors for ferrobase.

encodings

Character-encoding detection and the catalogue of supported text encodings.

filter

Django-filter FilterSet definitions for ferrobase models.

frontend

Primitives for pushing real-time UI updates over WebSocket to the frontend.

Provides a hierarchy of serialisable element types (Element, UpdateSpec, etc.) and FrontendUIUpdater, which broadcasts update specs to a Django Channels channel group so connected clients can apply them without a full page reload.

templating

Utilities for rendering Django templates from raw strings.

urls

URL configuration for the ferrobase application.

Subpackages

ferrobase.api

Detail page: ferrosoft.apps.ferrobase.api package.

exception
router
serializers
views

ferrobase.auth

Detail page: ferrosoft.apps.ferrobase.auth package.

roles

ferrobase.forms

Detail page: ferrosoft.apps.ferrobase.forms package.

copy
fields
model_forms

ferrobase.management

Detail page: ferrosoft.apps.ferrobase.management package.

ferrobase.middleware

Detail page: ferrosoft.apps.ferrobase.middleware package.

appmeta
asgi
cache
language
tenant

ferrobase.models

Detail page: ferrosoft.apps.ferrobase.models package.

base
builtin
decimal
fields
file
identity
registry
shared

Models shared between apps.

subscription
units

ferrobase.services

Detail page: ferrosoft.apps.ferrobase.services package.

captcha

Lightweight 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.

cleanup
conversion

Scientific unit conversion and normalisation.

Provides direct unit-to-unit conversion via the MULTIPLIERS lookup table and category-based normalisation via NORMALIZED_UNITS. All arithmetic is done with decimal.Decimal and quantised to PRECISION to absorb precision loss introduced by Django ORM fields.

help
idgenerator
onboarding
sse

Server Side Events (SSE) client for Python.

Provides a generator of SSE received through an existing HTTP response.

static_files
taskqueue
tenant_mgm

Tenant provisioning: PostgreSQL role/database creation, migrations and fixtures.

update
user_mgm
zitadel

HTTP REST client and request/response dataclasses for the ZITADEL IAM API v2.

ferrobase.session

Detail page: ferrosoft.apps.ferrobase.session package.

forms
password_reset

Password reset email dispatch using templated messages.

ferrobase.tables

Detail page: ferrosoft.apps.ferrobase.tables package.

columns

Reusable 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.

crud
models
table

ferrobase.templatetags

Detail page: ferrosoft.apps.ferrobase.templatetags package.

ajax

Template tags wiring the front-end AJAX/HTMX loading indicator.

bootstrap5
datetime
decimal
ferrobase

Core ferrobase template library.

Bundles tags and filters used throughout the platform’s templates: document title composition, model introspection, value formatting, simple format dispatch, association-list rendering, query-string helpers and context-help URL generation.

ferrobase_files
ferrobase_menu
foundation
iam
labels
tables

ferrobase.tenant

Detail page: ferrosoft.apps.ferrobase.tenant package.

context

Context-variable storage for the currently active tenant.

Multi-tenancy is propagated through a single ContextVar so that both threaded and asynchronous request handling pick up the correct tenant without any explicit argument passing. ORM helpers in ferrosoft.apps.ferrobase.tenant.utils consult this variable to pick the right database alias.

forms
tables
utils

ferrobase.views

Detail page: ferrosoft.apps.ferrobase.views package.

api_token
base
company_site
files
generic

Generic 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,

)

group

Views for group management. Groups are used in the Django permission system.

index
material
media
onboarding
organization
partner
password
session
settings
tenant
user