pub struct WritableCustomFieldRequest {Show 16 fields
pub id: Option<Uuid>,
pub content_types: Vec<String>,
pub label: String,
pub grouping: Option<String>,
pub type: Option<CustomFieldTypeChoices>,
pub key: Option<String>,
pub description: Option<String>,
pub required: Option<bool>,
pub filter_logic: Option<FilterLogicEnum>,
pub default: Option<Option<Value>>,
pub weight: Option<i32>,
pub validation_minimum: Option<Option<i64>>,
pub validation_maximum: Option<Option<i64>>,
pub validation_regex: Option<String>,
pub advanced_ui: Option<bool>,
pub scope_filter: Option<Option<Value>>,
}Expand description
WritableCustomFieldRequest : Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144)
Fields§
§id: Option<Uuid>§content_types: Vec<String>§label: String§grouping: Option<String>Human-readable grouping that this custom field belongs to.
type: Option<CustomFieldTypeChoices>§key: Option<String>Internal field name. Please use underscores rather than dashes in this key.
description: Option<String>A helpful description for this field.
required: Option<bool>If true, this field is required when creating new objects or editing an existing object.
filter_logic: Option<FilterLogicEnum>§default: Option<Option<Value>>Default value for the field (must be a JSON value). Encapsulate strings with double quotes (e.g. "Foo").
weight: Option<i32>Fields with higher weights appear lower in a form.
validation_minimum: Option<Option<i64>>Minimum allowed value (for numeric fields) or length (for text fields).
validation_maximum: Option<Option<i64>>Maximum allowed value (for numeric fields) or length (for text fields).
validation_regex: Option<String>Regular expression to enforce on text field values. Use ^ and $ to force matching of entire string. For example, ^[A-Z]{3}$ will limit values to exactly three uppercase letters. Regular expression on select and multi-select will be applied at Custom Field Choices definition.
advanced_ui: Option<bool>Hide this field from the object’s primary information tab. It will appear in the "Advanced" tab instead.
scope_filter: Option<Option<Value>>A JSON-encoded dictionary of filter parameters defining possible objects that can use this custom field.
Implementations§
Source§impl WritableCustomFieldRequest
impl WritableCustomFieldRequest
Sourcepub fn new(
content_types: Vec<String>,
label: String,
) -> WritableCustomFieldRequest
pub fn new( content_types: Vec<String>, label: String, ) -> WritableCustomFieldRequest
Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144)
Trait Implementations§
Source§impl Clone for WritableCustomFieldRequest
impl Clone for WritableCustomFieldRequest
Source§fn clone(&self) -> WritableCustomFieldRequest
fn clone(&self) -> WritableCustomFieldRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more