pub trait MultipleObjectMixin<T>: Send + Sync{
// Required method
fn get_objects<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
// Provided methods
fn get_ordering(&self) -> Option<Vec<String>> { ... }
fn allow_empty(&self) -> bool { ... }
fn get_paginate_by(&self) -> Option<usize> { ... }
fn get_context_object_name(&self) -> Option<&str> { ... }
fn get_context_data(
&self,
object_list: Vec<T>,
) -> Result<HashMap<String, Value>, Error> { ... }
}Available on non-WebAssembly only.
Expand description
Trait for views that work with multiple objects
Required Methods§
Provided Methods§
Sourcefn get_ordering(&self) -> Option<Vec<String>>
fn get_ordering(&self) -> Option<Vec<String>>
Get the ordering for the queryset
Sourcefn allow_empty(&self) -> bool
fn allow_empty(&self) -> bool
Whether to allow empty result sets
Sourcefn get_paginate_by(&self) -> Option<usize>
fn get_paginate_by(&self) -> Option<usize>
Get the number of items per page
Sourcefn get_context_object_name(&self) -> Option<&str>
fn get_context_object_name(&self) -> Option<&str>
Get the context object name