Built-ins
FieldTypeDefinition
Connect a Django field class to its Bloomerp editors, renderers, and lookups.
Use a stable definition ID in application field metadata. A symbolic lookup alias lets Python code retrieve the same registered definition.
| Setting | Type | Default | Description |
|---|---|---|---|
id | str | Required | Stable field type ID stored in application field metadata. |
documentation | str | '' | Markdown and tagged examples included in the generated developer reference. |
label | str | Required | Display name of the field type. |
description | str | None | None | Summary of the values this field type represents. |
icon | str | 'fa-solid fa-table-columns' | Icon used in the field picker. |
model_field_cls | type[Field] | None | None | Django field class associated with this type. |
construction | FieldConstruction | None | None | Constructor defaults and options used by the model builder. |
batch_value_loader | Optional[Callable[[Sequence[Model], Sequence[Any]], NoneType]] | None | Callback that preloads field values for a group of records. |
widget_factory | Optional[Callable[[FieldContext], Widget]] | None | Callback that builds the field's editor widget. |
form_factory | Optional[Callable[[FieldContext, Field | None], Field | None]] | None | Callback that builds or updates the Django form field. |
render_value | Callable[[Any, Model], Any] | _render_field_value | Callback that formats a value for display. |
lookups | tuple[LookupDefinition | BoundLookup, ...] | () | Filter operators enabled for this field type. |
display_options | Optional[Callable[[Any], tuple[FieldDisplayOption, ...]]] | None | Callback that lists display options for an application field. |
Register a field for warehouse codes
Create a distinct Django field subclass so Bloomerp can resolve the field type by class.
from django.db import models
from bloomerp.field_types.registry import FIELD_TYPE_REGISTRY, FieldTypeDefinition
from bloomerp.lookups.builtins import EQUALS
class WarehouseCodeField(models.CharField):
'''Store a warehouse code as short text.'''
warehouse_code = FieldTypeDefinition(
id="ExampleWarehouseCode",
label="Warehouse code",
description="A short warehouse reference.",
model_field_cls=WarehouseCodeField,
lookups=(EQUALS,),
)
FIELD_TYPE_REGISTRY.register("EXAMPLE_WAREHOUSE_CODE", warehouse_code)Expose constructor defaults in the model builder
The model builder can apply the field constructor arguments when it creates the field.
from django.db import models
from bloomerp.field_types.registry import FIELD_TYPE_REGISTRY, FieldConstruction, FieldTypeDefinition
class AssetLabelField(models.CharField):
'''Store an asset label as short text.'''
asset_label = FieldTypeDefinition(
id="ExampleAssetLabel",
label="Asset label",
model_field_cls=AssetLabelField,
construction=FieldConstruction(defaults={"max_length": 40}),
)
FIELD_TYPE_REGISTRY.register("EXAMPLE_ASSET_LABEL", asset_label)Char Field
ID CharField · Lookup ID CHAR_FIELD
Store short text such as a name, title, or reference number, with a configurable length limit.
| Field | Value |
|---|---|
icon | fa-solid fa-font |
Code Field
ID CodeField · Lookup ID CODE_FIELD
Store source code and edit it with syntax highlighting for the configured language.
| Field | Value |
|---|---|
icon | fa-solid fa-code |
Choice Field
ID ChoiceField · Lookup ID CHOICE_FIELD
Store one value from a predefined set of text choices and display its human-readable label.
| Field | Value |
|---|---|
icon | fa-solid fa-list |
Text Field
ID TextField · Lookup ID TEXT_FIELD
Store longer, multiline text such as a description or note.
| Field | Value |
|---|---|
icon | fa-solid fa-align-left |
Email Field
ID EmailField · Lookup ID EMAIL_FIELD
Store an email address and validate its format.
| Field | Value |
|---|---|
icon | fa-solid fa-envelope |
URL Field
ID URLField · Lookup ID URL_FIELD
Store a web address and validate its URL format.
| Field | Value |
|---|---|
icon | fa-solid fa-link |
Address Field
ID AddressField · Lookup ID ADDRESS_FIELD
Store a structured postal address as JSON and edit its parts in an address widget.
| Field | Value |
|---|---|
icon | fa-solid fa-location-dot |
Phone Number Field
ID PhoneNumberField · Lookup ID PHONE_NUMBER_FIELD
Store a telephone number and edit it with Bloomerp's phone number widget.
| Field | Value |
|---|---|
icon | fa-solid fa-phone |
Slug Field
ID SlugField · Lookup ID SLUG_FIELD
Store a URL-friendly identifier for a record.
| Field | Value |
|---|---|
icon | fa-solid fa-tag |
IP Address Field
ID IPAddressField · Lookup ID IP_ADDRESS_FIELD
Store an IP address using Django's generic IP address field.
| Field | Value |
|---|---|
icon | fa-solid fa-network-wired |
Generic IP Address Field
ID GenericIPAddressField · Lookup ID GENERIC_IP_ADDRESS_FIELD
Store an IPv4 or IPv6 address, with an optional protocol restriction.
| Field | Value |
|---|---|
icon | fa-solid fa-network-wired |
Icon Field
ID IconField · Lookup ID ICON_FIELD
Store an icon identifier selected through Bloomerp's icon picker.
| Field | Value |
|---|---|
icon | fa-solid fa-star |
Country Field
ID CountryField · Lookup ID COUNTRY_FIELD
Choose a country and store its country code.
| Field | Value |
|---|---|
icon | fa-solid fa-globe |
Auto Field
ID AutoField · Lookup ID AUTO_FIELD
Use an automatically assigned integer as the record's primary key.
| Field | Value |
|---|---|
icon | fa-solid fa-hashtag |
Big Auto Field
ID BigAutoField · Lookup ID BIG_AUTO_FIELD
Use an automatically assigned large integer as the record's primary key.
| Field | Value |
|---|---|
icon | fa-solid fa-hashtag |
Small Auto Field
ID SmallAutoField · Lookup ID SMALL_AUTO_FIELD
Use an automatically assigned small integer as the record's primary key.
| Field | Value |
|---|---|
icon | fa-solid fa-hashtag |
Integer Field
ID IntegerField · Lookup ID INTEGER_FIELD
Store whole numbers such as quantities, counts, or offsets.
| Field | Value |
|---|---|
icon | fa-solid fa-hashtag |
Float Field
ID FloatField · Lookup ID FLOAT_FIELD
Store approximate numeric values with a floating-point representation.
| Field | Value |
|---|---|
icon | fa-solid fa-calculator |
Decimal Field
ID DecimalField · Lookup ID DECIMAL_FIELD
Store decimal values with a defined precision, such as prices or measurements.
| Field | Value |
|---|---|
icon | fa-solid fa-calculator |
Positive Integer Field
ID PositiveIntegerField · Lookup ID POSITIVE_INTEGER_FIELD
Store a whole number that is zero or greater.
| Field | Value |
|---|---|
icon | fa-solid fa-plus |
Positive Small Integer Field
ID PositiveSmallIntegerField · Lookup ID POSITIVE_SMALL_INTEGER_FIELD
Store a nonnegative whole number in the small-integer range.
| Field | Value |
|---|---|
icon | fa-solid fa-plus |
Big Integer Field
ID BigIntegerField · Lookup ID BIG_INTEGER_FIELD
Store large signed whole numbers.
| Field | Value |
|---|---|
icon | fa-solid fa-hashtag |
Small Integer Field
ID SmallIntegerField · Lookup ID SMALL_INTEGER_FIELD
Store signed whole numbers in the small-integer range.
| Field | Value |
|---|---|
icon | fa-solid fa-hashtag |
Boolean Field
ID BooleanField · Lookup ID BOOLEAN_FIELD
Store a true or false value, such as whether a feature is enabled.
| Field | Value |
|---|---|
icon | fa-solid fa-toggle-on |
Null Boolean Field
ID NullBooleanField · Lookup ID NULL_BOOLEAN_FIELD
Store true, false, or an unset value when the answer is unknown.
| Field | Value |
|---|---|
icon | fa-solid fa-toggle-on |
Date Field
ID DateField · Lookup ID DATE_FIELD
Store a calendar date for values such as deadlines or birthdays.
| Field | Value |
|---|---|
icon | fa-solid fa-calendar-days |
Week Field
ID WeekField · Lookup ID WEEK_FIELD
Store an ISO year and week for planning or reporting by week.
| Field | Value |
|---|---|
icon | fa-solid fa-calendar-week |
DateTime Field
ID DateTimeField · Lookup ID DATE_TIME_FIELD
Store a date and time for values such as appointments and timestamps.
| Field | Value |
|---|---|
icon | fa-solid fa-clock |
Time Field
ID TimeField · Lookup ID TIME_FIELD
Store a time of day independently of the date.
| Field | Value |
|---|---|
icon | fa-solid fa-clock |
Duration Field
ID DurationField · Lookup ID DURATION_FIELD
Store an elapsed time or interval.
| Field | Value |
|---|---|
icon | fa-solid fa-hourglass-half |
Foreign Key
ID ForeignKey · Lookup ID FOREIGN_KEY
Link a record to another model, such as an invoice to its customer.
| Field | Value |
|---|---|
icon | fa-solid fa-link |
One To One Field
ID OneToOneField · Lookup ID ONE_TO_ONE_FIELD
Link a record to one unique record in another model.
| Field | Value |
|---|---|
icon | fa-solid fa-link |
Many To Many Field
ID ManyToManyField · Lookup ID MANY_TO_MANY_FIELD
Link any number of records on either side, such as products with categories.
| Field | Value |
|---|---|
icon | fa-solid fa-share-nodes |
One To Many Field
ID OneToManyField · Lookup ID ONE_TO_MANY_FIELD
Access the collection of records that point back to this record through a foreign key.
| Field | Value |
|---|---|
icon | fa-solid fa-share-nodes |
User Field
ID UserField · Lookup ID USER_FIELD
Link a record to a user, such as its owner or assignee.
| Field | Value |
|---|---|
icon | fa-solid fa-user |
One To One User Field
ID OneToOneUserField · Lookup ID ONE_TO_ONE_USER_FIELD
Link a record uniquely to a user, such as a profile that each user can have once.
| Field | Value |
|---|---|
icon | fa-solid fa-user |
Generic Relation
ID GenericRelation · Lookup ID GENERIC_RELATION
Expose records that point to this object through a generic foreign key.
| Field | Value |
|---|---|
icon | fa-solid fa-share-nodes |
Generic Foreign Key
ID GenericForeignKey · Lookup ID GENERIC_FOREIGN_KEY
Expose a reference to a record whose model can vary.
| Field | Value |
|---|---|
icon | fa-solid fa-link |
Files
ID FilesRelationField · Lookup ID FILES_RELATION_FIELD
Show files attached to the current record through Bloomerp's file references.
| Field | Value |
|---|---|
icon | fa-solid fa-paperclip |
Property
ID Property · Lookup ID PROPERTY
Expose a computed model attribute as a field in Bloomerp.
| Field | Value |
|---|---|
icon | fa-solid fa-sliders |
File Field
ID FileField · Lookup ID FILE_FIELD
Store a reference to an uploaded file in Django storage.
| Field | Value |
|---|---|
icon | fa-solid fa-file |
Image Field
ID ImageField · Lookup ID IMAGE_FIELD
Store an uploaded image and validate it as an image.
| Field | Value |
|---|---|
icon | fa-solid fa-image |
UUID Field
ID UUIDField · Lookup ID UUID_FIELD
Store a universally unique identifier.
| Field | Value |
|---|---|
icon | fa-solid fa-fingerprint |
Binary Field
ID BinaryField · Lookup ID BINARY_FIELD
Store raw bytes in a database field.
| Field | Value |
|---|---|
icon | fa-solid fa-code |
JSON Field
ID JSONField · Lookup ID JSON_FIELD
Store JSON values, including objects, arrays, and nested data.
| Field | Value |
|---|---|
icon | fa-solid fa-code |
Array Field
ID ArrayField · Lookup ID ARRAY_FIELD
Expose the values in a PostgreSQL array as a field in Bloomerp.
| Field | Value |
|---|---|
icon | fa-solid fa-list-ol |
HStore Field
ID HStoreField · Lookup ID HSTORE_FIELD
Expose a PostgreSQL mapping of text keys to values as a field in Bloomerp.
| Field | Value |
|---|---|
icon | fa-solid fa-box-archive |
Status Field
ID StatusField · Lookup ID STATUS_FIELD
Store a status choice with an associated color for display.
| Field | Value |
|---|---|
icon | fa-solid fa-signal |
Bloomerp File Field
ID BloomerpFileField · Lookup ID BLOOMERP_FILE_FIELD
Attach one or more files to a record through Bloomerp's file library.
| Field | Value |
|---|---|
icon | fa-solid fa-file-lines |
Labels
ID BloomerpLabelsField · Lookup ID LABELS_FIELD
Assign multiple labels to a record and filter records by label membership.
| Field | Value |
|---|---|
icon | fa-solid fa-tags |
