pub struct CustomLinkRequest {
pub id: Option<Uuid>,
pub content_type: String,
pub name: String,
pub text: String,
pub target_url: String,
pub weight: Option<i32>,
pub group_name: Option<String>,
pub button_class: Option<ButtonClassEnum>,
pub new_window: bool,
}Expand description
CustomLinkRequest : 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_type: String§name: String§text: StringJinja2 template code for link text. Reference the object as {{ obj }} such as {{ obj.platform.name }}. Links which render as empty text will not be displayed.
target_url: StringJinja2 template code for link URL. Reference the object as {{ obj }} such as {{ obj.platform.name }}.
weight: Option<i32>§group_name: Option<String>Links with the same group will appear as a dropdown menu
new_window: boolForce link to open in a new window
Implementations§
Source§impl CustomLinkRequest
impl CustomLinkRequest
Sourcepub fn new(
content_type: String,
name: String,
text: String,
target_url: String,
new_window: bool,
) -> CustomLinkRequest
pub fn new( content_type: String, name: String, text: String, target_url: String, new_window: bool, ) -> CustomLinkRequest
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 CustomLinkRequest
impl Clone for CustomLinkRequest
Source§fn clone(&self) -> CustomLinkRequest
fn clone(&self) -> CustomLinkRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more