pub struct ModelFormConfig {
pub fields: Option<Vec<String>>,
pub exclude: Vec<String>,
pub widgets: HashMap<String, Widget>,
pub labels: HashMap<String, String>,
pub help_texts: HashMap<String, String>,
}Expand description
ModelForm configuration
Fields§
§fields: Option<Vec<String>>Fields to include in the form (None = all fields)
exclude: Vec<String>Fields to exclude from the form
widgets: HashMap<String, Widget>Custom widgets for specific fields
labels: HashMap<String, String>Custom labels for specific fields
help_texts: HashMap<String, String>Custom help text for specific fields
Implementations§
Source§impl ModelFormConfig
impl ModelFormConfig
pub fn new() -> Self
pub fn fields(self, fields: Vec<String>) -> Self
pub fn exclude(self, exclude: Vec<String>) -> Self
pub fn widget(self, field: String, widget: Widget) -> Self
pub fn label(self, field: String, label: String) -> Self
pub fn help_text(self, field: String, text: String) -> Self
Trait Implementations§
Source§impl Clone for ModelFormConfig
impl Clone for ModelFormConfig
Source§fn clone(&self) -> ModelFormConfig
fn clone(&self) -> ModelFormConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelFormConfig
impl Debug for ModelFormConfig
Source§impl Default for ModelFormConfig
impl Default for ModelFormConfig
Source§fn default() -> ModelFormConfig
fn default() -> ModelFormConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ModelFormConfig
impl RefUnwindSafe for ModelFormConfig
impl Send for ModelFormConfig
impl Sync for ModelFormConfig
impl Unpin for ModelFormConfig
impl UnsafeUnpin for ModelFormConfig
impl UnwindSafe for ModelFormConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more