pub struct CustomFieldRequest {Show 22 fields
pub object_types: Vec<String>,
pub type: RHashType,
pub related_object_type: Option<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<FilterLogic>,
pub ui_visible: Option<UiVisible>,
pub ui_editable: Option<UiEditable>,
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<CustomFieldRequestChoiceSet>>>,
pub comments: Option<String>,
}Expand description
CustomFieldRequest : 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§
§object_types: Vec<String>§type: RHashTypetext- Text *longtext- Text (long) *integer- Integer *decimal- Decimal *boolean- Boolean (true/false) *date- Date *datetime- Date & time *url- URL *json- JSON *select- Selection *multiselect- Multiple selection *object- Object *multiobject- Multiple objects
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<FilterLogic>disabled- Disabled *loose- Loose *exact- Exact
ui_visible: Option<UiVisible>always- Always *if-set- If set *hidden- Hidden
ui_editable: Option<UiEditable>yes- Yes *no- No *hidden- Hidden
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<CustomFieldRequestChoiceSet>>>§comments: Option<String>Implementations§
Source§impl CustomFieldRequest
impl CustomFieldRequest
Sourcepub fn new(
object_types: Vec<String>,
type: RHashType,
name: String,
) -> CustomFieldRequest
pub fn new( object_types: Vec<String>, type: RHashType, name: String, ) -> CustomFieldRequest
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 CustomFieldRequest
impl Clone for CustomFieldRequest
Source§fn clone(&self) -> CustomFieldRequest
fn clone(&self) -> CustomFieldRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more