Expand description
Column and ordering types for Rango ORM.
Structs§
- Column
- A typed column reference:
Mis the model,Tthe field type. - Many
ToMany Field - A
ManyToMany<R>field onM:#[derive(Model)]generatesArticle::TAGSfor atags: ManyToMany<Tag>field. Not a column, so it only works withprefetch_related. - Ordering
- An ordering for a column.
Enums§
- Prefetch
Kind - How
prefetch_relatedfinds theRrows of eachM.
Traits§
- Column
Ref - A column reference accepted by query builder methods: either a typed
Column<M, T>generated by#[derive(Model)](checked at compile time) or a&str(checked by the database at runtime). - Filter
Column - A column accepted by comparison filters (
eq,gt, …) together with its value typeV. - Filter
Value - A value that can be compared to a column of field type
T: the field type itself, or its plain Rust equivalent (i32forFieldInt,&strforFieldEmail, …). Filter values are not validated like field constructors are:"not-an-email"is a valid value to search for. - Foreign
KeyRef - A foreign key column on
Mpointing toT:Post::AUTHOR_ID(anauthor_id: ForeignKey<User>field) is aForeignKeyRef<Post, User>, so relation methods infer the related model and reject a column that points elsewhere.&stris accepted too (then name the model with::<T>). - Order
Ref - Accepted by
order_by:Column<M, T>(ascending),Ordering<M>(from.asc()/.desc()), or&strwhere a leading-means descending (Django style). - Prefetch
Ref - Accepted by
prefetch_related: a reverse foreign key (Comment::POST_ID, apost_id: ForeignKey<Post>field onComment), a M2M field (Article::TAGS), or&strnaming the reverse FK column (then name the model with::<R>).