Model Field Types

You can refer to this documentation page when you will need to know which Field type to return or to implement filtering lookups.

To know how to display, serialize, deserialize and filter model fields Jet Admin should know their types. Here is the list of supported Jet Admin types. In Model Descriptions endpoint you should return any of types listed in Allowed names section. Also you should implement listed Supported lookups for all fields in order for filtering to work.

To detect field type Jet Admin will search among Allowed names to detect what is the field type (Text Field will be used by default if none found).

Text Field (Default)

Allowed names:

  • CharField

  • TextField

Supported lookups:

  • contains (string)

  • exact (string)

  • startswith (string)

  • endswith (string)

  • isnull (boolean)

  • in (string) - comma separated

Number Field

Allowed names:

  • IntegerField

  • FloatField

  • DecimalField

Supported lookups:

  • exact (number)

  • gte (number)

  • gt (number)

  • lte (number)

  • lt (number)

  • isnull (boolean)

  • in (string) - comma separated

Boolean Field

Allowed names:

  • BooleanField

  • NullBooleanField

Supported lookups:

  • exact (boolean)

Select Field

Allowed names:

  • SelectField

Supported lookups:

  • exact (string)

  • isnull (boolean)

  • in (string) - comma separated

Allowed params:

{
// Specify possible dropdown values
"params": {
"options": [
{
"color":"blue",
"name":"accept",
"value":"accept"
},
{
"color":"red",
"name":"decline",
"value":"decline"
},
{
"color":"green",
"name":"new",
"value":"new"
}
]
}

Related Model

Allowed names:

  • ForeignKey

  • OneToOneField

Supported lookups:

  • exact (string)

  • isnull (boolean)

  • in (string) - comma separated

Allowed params:

{
// Specify which model to refer
"params": {
"related_model": [
{
"model": "core_country"
}
]
}

DateTimeField

Allowed names:

  • DateTimeField

Supported lookups:

  • gte (iso datetime)

  • gt (iso datetime)

  • lte (iso datetime)

  • lt (iso datetime)

  • exact (iso datetime)

  • isnull (boolean)

  • in (string) - comma separated

TimestampField

Allowed names:

  • TimestampField

Supported lookups:

  • gte (iso datetime)

  • gt (iso datetime)

  • lte (iso datetime)

  • lt (iso datetime)

  • exact (iso datetime)

  • isnull (boolean)

  • in (string) - comma separated

Date Field

Allowed names:

  • DateField

Supported lookups:

  • gte (iso datetime)

  • gt (iso datetime)

  • lte (iso datetime)

  • lt (iso datetime)

  • exact (iso datetime)

  • isnull (boolean)

  • in (string) - comma separated

Time Field

Allowed names:

  • TimeField

Supported lookups:

  • exact (number)

  • gte (number)

  • gt (number)

  • lte (number)

  • lt (number)

  • isnull (boolean)

  • in (string) - comma separated

JSON Field

Allowed names:

  • JSONField

Supported lookups:

  • json_icontains (string)

  • isnull (boolean)

File Field

Allowed names:

  • FileField

Image Field

Allowed names:

  • ImageField

You should add media_url_template property to your /api/ endpoint response as state here – Get Jet Bridge Info.

Translatable Field

Allowed names:

  • TranslatableField

Supported lookups:

  • contains (string)

  • exact (string)

  • startswith (string)

  • endswith (string)

  • isnull (boolean)

  • in (string) - comma separated

Geography Field

  • GeographyField