pub struct CustomLink {Show 16 fields
pub id: Option<Uuid>,
pub object_type: Option<String>,
pub display: Option<String>,
pub url: Option<String>,
pub natural_slug: Option<String>,
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,
pub created: Option<Option<String>>,
pub last_updated: Option<Option<String>>,
pub notes_url: Option<String>,
}Expand description
CustomLink : 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>§object_type: Option<String>§display: Option<String>Human friendly display value
url: Option<String>§natural_slug: Option<String>§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
created: Option<Option<String>>§last_updated: Option<Option<String>>§notes_url: Option<String>Implementations§
Source§impl CustomLink
impl CustomLink
Sourcepub fn new(
content_type: String,
name: String,
text: String,
target_url: String,
new_window: bool,
) -> CustomLink
pub fn new( content_type: String, name: String, text: String, target_url: String, new_window: bool, ) -> CustomLink
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 CustomLink
impl Clone for CustomLink
Source§fn clone(&self) -> CustomLink
fn clone(&self) -> CustomLink
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more