runique 2.1.10

A Django-inspired web framework for Rust with ORM, templates, and comprehensive security middleware
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! `ModelForm` trait — links a form to a `ModelSchema`, generates fields automatically.

pub trait ModelForm: Sized + Send + Sync {
    fn schema() -> crate::migration::schema::ModelSchema;
    fn fields() -> Option<&'static [&'static str]> {
        None
    }
    fn exclude() -> Option<&'static [&'static str]> {
        None
    }
    fn model_register_fields(form: &mut crate::forms::Forms) {
        Self::schema().fill_form(form, Self::fields(), Self::exclude());
    }
}