View Source Pageantry.Validation (Pageantry v0.5.2)
Definitions and restrictions for paging/sorting/filtering.
Fields
schema
: Ecto schema to be paged.max_off
: Maximum page offset,0
for unlimited (the default).max_max
: Maximum max-items-per-page, eg1000
.max_pages
: Maximum pages to display in UI paging control, eg10
for a control like "<< 1 2 3 4 5 6 7 8 9 10 >>".base_sort
: Sort always applied after user-supplied sort, eg[asc: :id]
to always sort byid
field as the last item of the SQLORDER
clause.base_filter
: Filter always applied in addition to user-supplied filter, eg[active: true]
to restrict results to active items only.fields
: Keyword list of fields that can be used for sorting/filtering. The field keywords represent the name of the field exposed to the user, and don't have to match the field name in the schema. For example,user_id
can be used for theid
field of theUser
schema andorg_id
can be used for theid
field of theOrganization
schema, etc.
Summary
Types
@type t() :: %Pageantry.Validation{ base_filter: keyword(atom()), base_sort: keyword(atom()), fields: keyword(Pageantry.Field.t()), max_max: integer(), max_off: integer(), max_pages: integer(), schema: Ecto.Schema.t() }