pub struct CustomField {Show 29 fields
pub id: Option<i32>,
pub url: Option<String>,
pub display_url: Option<String>,
pub display: Option<String>,
pub object_types: Vec<String>,
pub type: Box<CustomFieldType>,
pub related_object_type: Option<Option<String>>,
pub data_type: Option<String>,
pub name: String,
pub label: Option<String>,
pub group_name: Option<String>,
pub description: Option<String>,
pub required: Option<bool>,
pub unique: Option<bool>,
pub search_weight: Option<i32>,
pub filter_logic: Option<Box<CustomFieldFilterLogic>>,
pub ui_visible: Option<Box<CustomFieldUiVisible>>,
pub ui_editable: Option<Box<CustomFieldUiEditable>>,
pub is_cloneable: Option<bool>,
pub default: Option<Option<Value>>,
pub related_object_filter: Option<Option<Value>>,
pub weight: Option<i32>,
pub validation_minimum: Option<Option<f64>>,
pub validation_maximum: Option<Option<f64>>,
pub validation_regex: Option<String>,
pub choice_set: Option<Option<Box<BriefCustomFieldChoiceSet>>>,
pub comments: Option<String>,
pub created: Option<Option<String>>,
pub last_updated: Option<Option<String>>,
}Expand description
CustomField : 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<i32>§url: Option<String>§display_url: Option<String>§display: Option<String>§object_types: Vec<String>§type: Box<CustomFieldType>§data_type: Option<String>§name: StringInternal field name
label: Option<String>Name of the field as displayed to users (if not provided, ’the field’s name will be used)
group_name: Option<String>Custom fields within the same group will be displayed together
description: Option<String>§required: Option<bool>This field is required when creating new objects or editing an existing object.
unique: Option<bool>The value of this field must be unique for the assigned object
search_weight: Option<i32>Weighting for search. Lower values are considered more important. Fields with a search weight of zero will be ignored.
filter_logic: Option<Box<CustomFieldFilterLogic>>§ui_visible: Option<Box<CustomFieldUiVisible>>§ui_editable: Option<Box<CustomFieldUiEditable>>§is_cloneable: Option<bool>Replicate this value when cloning objects
default: Option<Option<Value>>Default value for the field (must be a JSON value). Encapsulate strings with double quotes (e.g. "Foo").
Filter the object selection choices using a query_params dict (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<f64>>Minimum allowed value (for numeric fields)
validation_maximum: Option<Option<f64>>Maximum allowed value (for numeric 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.
choice_set: Option<Option<Box<BriefCustomFieldChoiceSet>>>§comments: Option<String>§created: Option<Option<String>>§last_updated: Option<Option<String>>Implementations§
Source§impl CustomField
impl CustomField
Sourcepub fn new(
object_types: Vec<String>,
type: CustomFieldType,
name: String,
) -> CustomField
pub fn new( object_types: Vec<String>, type: CustomFieldType, name: String, ) -> CustomField
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 CustomField
impl Clone for CustomField
Source§fn clone(&self) -> CustomField
fn clone(&self) -> CustomField
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more