Models
Django model domains, managers, and querysets. Import each model from its defining domain module; the micboard.models package intentionally does not re-export model classes.
micboard.models.hardware
Hardware model domain.
micboard.models.hardware.charger
Charger and charger slot models for wireless equipment charging and storage.
Charger
Bases: models.Model
Charger unit for field wireless devices (bodypacks, handheld, IEM receivers).
save(*args: Any, **kwargs: Any) -> None
Keep the IP-ownership check and row write in one transaction.
ChargerSlot
Bases: models.Model
Individual charging slot on a charger unit.
Decoupled from WirelessUnit to allow multiple different devices to dock over time without link rot.
micboard.models.hardware.display_wall
Display wall and kiosk models for stage/monitor display management.
DisplayWall
Bases: models.Model
Physical display kiosk/screen showing stage/charger status.
Represents a single physical display (monitor/TV/kiosk) positioned in a venue showing real-time performer status, RF channel info, and battery levels. Multiple walls can exist in the same location (e.g., stage monitor, backstage display, FOH position).
clean() -> None
Reject refresh rates that can storm clients or overflow browser timers.
WallSection
Bases: models.Model
Section of a display wall assigned to show charger performers.
A display wall can be divided into sections, each showing a different charger’s docked devices and their performers. Sections define layout and positioning (grid cells, carousel, etc.).
micboard.models.hardware.wireless_chassis
WirelessChassis model: Base station/rack unit for wireless audio systems.
Represents the PHYSICAL CHASSIS/RACK UNIT (stationary, rack-mounted hardware with IP/location). NOT the field devices (wireless units) — those are represented by the WirelessUnit model.
This chassis supports polymorphic RF roles:
- receiver: Chassis receives RF signals from field wireless units (traditional wireless mics) Example: Shure AD4Q receives from 4 field wireless microphones
- transmitter: Chassis sends IEM mixes to field wireless units (in-ear monitoring) Example: Shure PSM sends monitor mixes to performers
- transceiver: Chassis both receives mic signals AND sends IEM mixes (hybrid bidirectional) Example: Sennheiser Spectera Base (64 ch total: 32-in + 32-out)
Each chassis is tied to a manufacturer and model, looked up in device_specifications.yaml for RFChannel capacity, Dante support, and device capabilities.
Field devices (wireless units: bodypacks, handhelds, IEM receivers) are represented by the WirelessUnit model and link back to their host chassis via base_chassis FK.
Architecture & Future-Proofing Notes: *** Bidirectional Systems (Sennheiser Spectera model): Spectera Base uses WMAS technology to duplexer 64 total channels: 32 RF channels receiving mic signals FROM field SEK bodypacks + 32 RF channels sending IEM mixes TO the SAME field units (or others). Each SEK is a transceiver simultaneously capturing mic audio and playing back IEM. The model handles this via transceiver role + bidirectional RF channels with separate metrics for RX/TX.
*** Multi-Protocol/License-Pool Systems (Shure Axient ANX4 model): ANX4 is a receiver that can simultaneously host both Axient Digital AND ULX-D wireless units on the same 4 channels. This is handled as a receiver role with 4 RF channels, where each channel can accept either protocol family at runtime. Floating channel licensing (multiple wireless units per RF channel) is tracked via WirelessUnit.active statuses and channel_link references.
*** Future-Proofing: New wireless systems should map to existing roles (receiver/transmitter/transceiver) and channel directions (receive/send/bidirectional) without requiring code changes. Role and direction enums are intentionally manufacturer-agnostic. When adding new vendors or models, ask: Is this receiving, transmitting, or both? Does each channel have a single direction or multiple? If patterns don’t fit, it’s a signal to revisit the architecture rather than patch with new roles.
WirelessChassis
Bases: models.Model
BASE STATION/RACK UNIT for wireless audio systems (receiver/transmitter/transceiver).
This model represents the STATIONARY, RACK-MOUNTED chassis hardware. NOT the field-side wireless units (which are WirelessUnit model instances).
The chassis’ RF role determines its function:
- receiver role: Receives RF from field wireless units (traditional wireless mics)
- transmitter role: Sends IEM mixes to field wireless units
- transceiver role: Both receive and send (hybrid systems like Sennheiser Spectera)
Field wireless units link to their host chassis via WirelessUnit.base_chassis FK. RFChannel represents RF communication channels/slots on this chassis.
save(*args: Any, **kwargs: Any) -> None
Keep the IP-ownership check and row write in one transaction.
delete(*args: Any, **kwargs: Any) -> tuple[int, dict[str, int]]
Keep delete receivers and the row deletion in one transaction.
get_expected_channel_count() -> int
Get expected number of channels based on device model.
micboard.models.hardware.wireless_unit
WirelessUnit model for field wireless audio devices.
Represents field-side wireless devices (bodypacks, handheld, IEM receivers, etc.) with awareness of device type:
- mic_transmitter: Sends mic audio to chassis (traditional wireless mics)
- iem_receiver: Receives IEM mix from chassis (in-ear monitoring)
- transceiver: Both send mic and receive IEM (e.g., Sennheiser Spectera SEK)
Tracks battery levels, RF quality, link quality, and device state. Links to WirelessChassis base unit and RFChannel for RF path tracking.
WirelessUnitQuerySet
Bases: TenantOptimizedQuerySet
Enhanced queryset for WirelessUnit model with tenant filtering.
for_user(user: Any) -> WirelessUnitQuerySet
Return units reachable through the user’s monitoring-group scope.
WirelessUnit
Bases: models.Model
Field-side wireless audio device (bodypack, handheld, IEM receiver, etc.).
micboard.models.monitoring
Monitoring model domain.
micboard.models.monitoring.alert
UserAlertPreference
Bases: models.Model
Global alert preferences per user.
Device-specific preferences override these defaults.
is_quiet_hours(current_time: time | None = None) -> bool
Check if current time is within quiet hours.
Alert
Bases: models.Model
Stores alert history for auditing and tracking.
micboard.models.monitoring.group
Group models for logical organization of devices, channels, and users.
Contains:
- MonitoringGroup: Robust team/permission grouping.
MonitoringGroup
Bases: models.Model
Represents a group of users who monitor specific devices together.
Useful for organizing teams (e.g., “Theater Tech Team”, “Conference Room A Staff”).
MonitoringGroupLocation
Bases: models.Model
Intermediary model for MonitoringGroup and Location, specifying access scope.
micboard.models.monitoring.performer
Performer model for device users assigned to wireless units.
PerformerQuerySet
Bases: TenantOptimizedQuerySet
Query helpers for performers with tenant awareness.
for_user(user: Any) -> PerformerQuerySet
Return performers managed by one of the user’s active monitoring groups.
In single-tenant mode, unassigned performers remain available so an operator can create their first assignment. MSP mode cannot safely expose a tenantless performer, so it only returns performers already linked through a tenant-scoped assignment.
Performer
Bases: models.Model
Represents a performer/talent with assigned wireless devices.
Performers are device users (musicians, actors, speakers, etc.) who use WirelessUnits. They are separate from Users (technicians/admins) who monitor and manage the devices.
get_assigned_units() -> QuerySet[Any]
Get all wireless units assigned to this performer.
get_monitoring_groups() -> QuerySet[Any]
Get all monitoring groups that manage this performer.
micboard.models.monitoring.performer_assignment
Performer assignment model linking performers to wireless units.
PerformerAssignmentQuerySet
Bases: TenantOptimizedQuerySet
Query helpers for performer assignments with tenant awareness.
for_user(user: Any) -> PerformerAssignmentQuerySet
Return assignments in the user’s active monitoring groups.
active() -> PerformerAssignmentQuerySet
Get all active assignments.
PerformerAssignment
Bases: models.Model
Assignment of a performer to a wireless unit.
Represents the link between a performer (talent) and the wireless device they will use. Allows multiple performers to share units across different events/sessions, and tracks metadata about each assignment.
micboard.models.locations
Location hierarchy model domain.
micboard.models.locations.structure
Location hierarchy models for physical device placement tracking.
Provides three-tier location structure: Building > Room > Location. Used for device assignment, movement tracking, and spatial organization.
Optional multi-tenancy support:
- MICBOARD_MULTI_SITE_MODE: Adds site FK to Building
- MICBOARD_MSP_ENABLED: Uses indexed organization and campus identifiers on Building
Building
Bases: models.Model
Represents a physical building.
Multi-tenancy support:
- site: Optional Django Site FK (when MICBOARD_MULTI_SITE_MODE=True)
- organization_id: Optional Organization identifier (when MICBOARD_MSP_ENABLED=True)
- campus_id: Optional Campus identifier (when MICBOARD_MSP_ENABLED=True)
clean() -> None
Require a campus to belong to the selected organization.
Room
Bases: models.Model
Represents a room within a building.
Location
Bases: models.Model
Represents a specific point of interest within a building and room.
This model links to Building and Room for structured location management.
micboard.models.settings
Database-backed settings model domain.
micboard.models.settings.registry
Settings registry models for database-backed configuration.
SettingDefinition
Bases: models.Model
Defines a setting that can be configured by admins.
clean() -> None
Validate defaults and preserve the contract of stored overrides.
parse_value(raw_value: str) -> Any
Parse raw string value according to setting type.
serialize_value(value: Any) -> str
Serialize value to string for storage.
Setting
Bases: models.Model
Actual setting values, scoped by organization/site/manufacturer.
get_parsed_value() -> Any
Get the parsed value according to definition type.
clean() -> None
Require one target matching the definition’s declared scope.
set_value(value: Any) -> None
Set value and automatically serialize.
micboard.models.telemetry
Telemetry model domain.
micboard.models.telemetry.health
API health monitoring and logging models.
APIHealthLog
Bases: models.Model
Logs API availability and health status for manufacturers.
micboard.models.telemetry.sessions
Wireless unit session and sample models for telemetry tracking.
WirelessUnitSession
Bases: models.Model
Represents a period where a wireless unit is considered active.
WirelessUnitSample
Bases: models.Model
A single data point captured during a wireless unit session.
micboard.models.discovery
Discovery model domain.
micboard.models.discovery.configuration
Configuration models for managing manufacturer service configurations.
Allows admin to:
- Enable/disable services
- Override configuration values
- Validate configuration
- Track configuration changes
ManufacturerConfiguration
Bases: models.Model
Configuration for a manufacturer service.
Allows admin-level configuration overrides and validation. Replaces environment variables and settings.py configuration.
clean() -> None
Validate before saving.
micboard.models.discovery.discovery_queue
Discovery queue and device movement tracking.
DiscoveryQueue
Bases: models.Model
Staging area for discovered devices awaiting admin approval before import.
Implements the “Do you want to import these discovered items?” workflow.
DeviceMovementLog
Bases: models.Model
Tracks when devices change IP addresses or physical locations.
Used for auditing and alerting when devices move in the network.
micboard.models.discovery.manufacturer
Manufacturer model for device vendor registry.
Manufacturer
Bases: models.Model
Represents a device manufacturer with audit logging.
micboard.models.discovery.registry
Discovery job and configuration models.
MicboardConfig
Bases: models.Model
Global configuration settings.
DiscoveryCIDR
Bases: models.Model
CIDR ranges to be used for discovery scans.
DiscoveryFQDN
Bases: models.Model
FQDN patterns or hostnames to resolve for discovery.
DiscoveryJob
Bases: models.Model
Records an on-demand or automatic discovery job run.
DiscoveredDevice
Bases: models.Model
Represents a device discovered on the network but not yet configured.
This model is manufacturer-agnostic and stores device discovery information from any manufacturer API (Shure, Sennheiser, Audio-Technica, etc.). Manufacturer-specific fields are stored in the metadata JSONField.
micboard.models.realtime
Real-time connection model domain.
micboard.models.realtime.connection
Models for tracking real-time connections and subscriptions.
RealTimeConnectionQuerySet
Bases: models.QuerySet['RealTimeConnection']
Every state a realtime connection can be moved into, defined once.
Each transition is a bulk update, so a single row held by the subscription runner and a changelist selection made in the admin go through the same definition and cannot drift into different spellings of the same state.
mark_connecting() -> int
Record that a connection attempt is in progress.
The error history is deliberately preserved: a reconnect is not yet a success.
mark_connected() -> int
Record an established connection and clear every trace of the last failure.
record_message() -> int
Record message activity, establishing a connection that was still pending.
Live rows are moved first. Establishing pending rows first would leave them matching
the status="connected" filter as well, counting one row twice.
mark_error(error_message: str) -> int
Record one redacted transport error, counting consecutive failures.
mark_disconnected() -> int
Record an unintentional loss of the connection.
mark_stopped() -> int
Record an intentional connection stop.
reset_errors() -> int
Clear a stale error count without claiming the connection is back.
RealTimeConnection
Bases: models.Model
Tracks real-time connections (SSE/WebSocket) for wireless chassis.
micboard.models.rf_coordination
RF coordination model domain.
micboard.models.rf_coordination.compliance
Regulatory compliance models for RF coordination.
Provides models to track regulatory domains (FCC, ETSI), excluded frequency ranges, and compliance rules for specific locations.
RegulatoryDomain
Bases: models.Model
Regulatory body or region governing RF spectrum usage (e.g., FCC, ETSI).
FrequencyBand
Bases: models.Model
Specific frequency band within a regulatory domain.
ExclusionZone
Bases: models.Model
Geo-fenced area with specific frequency exclusions (e.g., near TV towers).
micboard.models.rf_coordination.rf_channel
RFChannel model for directional RF communication channels on a wireless chassis.
Each RF channel represents an RF communication path with direction awareness:
- receive: Field devices send to chassis (traditional wireless mics)
- send: Chassis sends to field devices (IEM systems)
- bidirectional: Both directions (hybrid systems like Sennheiser Spectera)
RFChannelQuerySet
Bases: TenantOptimizedQuerySet
Enhanced queryset for RFChannel model with tenant and direction filtering.
for_user(user: User) -> RFChannelQuerySet
Filter RF channels accessible to user via monitoring groups.
RFChannel
Bases: models.Model
Represents a directional RF communication channel on a wireless chassis.
micboard.models.users
User model domain.
micboard.models.users.user_profile
User profile extensions for technicians and administrators.
Extends standard User with role and monitoring preferences. Performers (talent/device users) are represented by the Performer model.
UserProfile
Bases: models.Model
Profile extending standard User for technicians and administrators.
Technicians and admins monitor and manage performer assignments and wireless devices within their assigned MonitoringGroups.
get_monitoring_groups() -> models.QuerySet
Get all monitoring groups this user is a member of.
get_accessible_performers() -> models.QuerySet
Get all performers accessible through user’s monitoring groups.
get_accessible_devices() -> models.QuerySet
Get all wireless units accessible through user’s monitoring groups.
micboard.models.users.user_views
User-specific view configurations and layout preferences.
Stores per-user dashboard configurations including selected views, filter preferences, and display settings. Enables personalized monitoring experiences for different operators and administrators.
UserView
Bases: models.Model
Persist a user’s saved dashboard view configuration.
micboard.models.audit
Audit and activity logging model domain.
micboard.models.audit.activity_log
Activity logging models for comprehensive audit trail.
Tracks all CRUD operations, service syncs, and system events.
ActivityLog
Bases: models.Model
Comprehensive activity log for all system operations.
Tracks CRUD operations, service sync events, and system activities.
ServiceSyncLog
Bases: models.Model
Detailed log of service synchronization events.
duration_seconds() -> int
Get sync duration in seconds.
micboard.models.audit.configuration_log
Audit log for configuration changes.
ConfigurationAuditLog
Bases: models.Model
Audit log for configuration changes.
micboard.models.band_plans
Band plan specifications: frequency ranges and regional allocations.
Loads band plan specifications from fixtures/band_plans.yaml. Each band plan defines a frequency range, region, and name for wireless microphone systems.
get_band_plan(manufacturer: str | None, band_plan_key: str | None) -> dict | None
Look up band plan specifications by manufacturer and band plan key.
Parameters:
manufacturer(str | None) — Manufacturer code (e.g., “shure”, “sennheiser”)band_plan_key(str | None) — Band plan identifier (e.g., “g50”, “aw_plus”)
Returns:
dict | None— Band plan dict with keys: name, min_mhz, max_mhz, regiondict | None— None if not found
get_available_band_plans(manufacturer: str | None) -> list[tuple[str, str]]
Get list of available band plans for a manufacturer.
Parameters:
manufacturer(str | None) — Manufacturer code (e.g., “shure”, “sennheiser”)
Returns:
list[tuple[str, str]]— List of (key, name) tuples for all available band planslist[tuple[str, str]]— Empty list if manufacturer not found
parse_band_plan_from_name(name: str) -> dict | None
Parse frequency range from a band plan name string.
Attempts to extract min/max frequencies from common name patterns like:
- “G50 (470-534 MHz)”
- “Aw+ (470-558 MHz)”
- “Block 470 (470-537 MHz)”
Parameters:
name(str) — Band plan name string
Returns:
dict | None— Dict with ‘min_mhz’ and ‘max_mhz’ if parsing successfuldict | None— None if unable to parse
detect_band_plan_from_api_string(api_band_value: str | None, manufacturer: str | None = 'shure') -> str | None
Detect and return band plan name from API frequencyBand string.
Uses module-level helpers to keep this function concise and easier to maintain; strategies include exact key match, code-prefix match, exact frequency-range match, and partial string match.
get_band_plan_from_model_code(manufacturer: str | None, model: str | None) -> str | None
Get default band plan for a device model based on manufacturer specs.
Some device models have a default/standard band plan. For example:
- Shure ULX-D G5 variant is typically G50 band
- Sennheiser ew 100 G3 might be A band
Parameters:
manufacturer(str | None) — Manufacturer codemodel(str | None) — Device model string
Returns:
str | None— Band plan name if model has a standard band plan, None otherwise
micboard.models.device_specs
Device specifications: channel capabilities, roles, and features.
Loads specifications for wireless audio devices from fixtures/device_specifications.yaml. Each device is characterized by:
- Role: receiver (receives from field), transmitter (sends to field), or transceiver (both)
- Channels: number of RF channels
- Dante: whether it supports Dante audio networking
- Bodypack capability: what types of field devices it can work with
Supported Manufacturers: Shure, Sennheiser, Wisycom, ULBACO, etc.
get_device_spec(manufacturer: str | None, model: str | None) -> dict | None
Look up device specifications by manufacturer and model.
Parameters:
manufacturer(str | None) — Manufacturer code (e.g., “shure”, “sennheiser”, “wisycom”)model(str | None) — Device model string (e.g., “AD4Q”, “Spectera Base”)
Returns:
dict | None— Spec dict with keys: channels, role, dante, name, modelsdict | None— None if not found
get_channel_count(manufacturer: str | None, model: str | None) -> int
Get channel count for a device.
Parameters:
manufacturer(str | None) — Manufacturer code (e.g., “shure”, “sennheiser”)model(str | None) — Device model string
Returns:
int— Number of channels (defaults to 4 if unknown)
get_device_role(manufacturer: str | None, model: str | None) -> str
Get device role/type.
Parameters:
manufacturer(str | None) — Manufacturer codemodel(str | None) — Device model string
Returns:
Role(str) — “receiver”, “transmitter”, or “transceiver”str— Defaults to “receiver” if unknown
get_dante_support(manufacturer: str | None, model: str | None) -> bool
Check if device supports Dante audio networking.
Parameters:
manufacturer(str | None) — Manufacturer codemodel(str | None) — Device model string
Returns:
bool— True if device has Dante support
micboard.models.integrations
Integration models for managing external manufacturer API connections.
ManufacturerAPIServer
Bases: models.Model
Manage multiple API servers per manufacturer across different locations.
clean() -> None
Validate API server configuration.
to_config_dict() -> dict
Convert to configuration dict format for API client initialization.
Accessory
Bases: models.Model
Track field unit accessories like lav mics, packs, IEM earbuds, etc.
micboard.models.base_managers
Enhanced model managers with tenant support and optimizations.
Base classes for all models to support:
- Multi-tenancy (organization, campus, site)
- Optimization hints (select_related, prefetch_related)
- Common filtering patterns
OrganizationLike
Bases: Protocol
Structural tenant identifier accepted by queryset filters.
TenantOptimizedQuerySet
Bases: models.QuerySet[_ModelT]
Base QuerySet with tenant filtering and optimization methods.
Provides the canonical tenant filters and common ORM optimizations.
supports_membership_scope() -> bool
Return whether this model has an explicit tenant ownership path.
for_site(site_id: int | None = None) -> TenantOptimizedQuerySet[_ModelT]
Filter by Django Site (multi-site mode).
for_memberships(memberships: Sequence[tuple[int, int | None]]) -> TenantOptimizedQuerySet[_ModelT]
Filter through explicit organization/campus membership identifiers.
for_user(user: Any) -> TenantOptimizedQuerySet[_ModelT]
Filter based on user permissions and tenant context.
Respects MSP, multi-site, and single-site modes.
micboard.models.mixins
Migration-stable model mixins.
DiscoveryTriggerMixin
Migration-stable marker retained for historical model state loading.
