-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collections, pagination, sorting #17
Comments
I've implemented a basic collection model: pub struct Collection {
// The set of triples that form the basis of the data
pub tpf: TPFQuery,
// List of all the pages.
pub pages: Vec<Page>,
// URL of the value to sort by
pub sort_by: String,
// Sorts ascending by default
pub sort_desc: bool,
// How many items per page
pub page_size: u8,
// Current page number, defaults to 0 (first page)
pub current_page: u8,
// Total number of items
pub total_items: u8,
// Total number of pages
pub total_pages: u8,
} However, one question still remains: how does a user access a collection? A Collection uses query params (which isn't standardized in Atomic Data yet) to browser pages, or do sorting. I'd like to implement Collections in Atomic-Lib without having any special handlers or views in Atomic-Server. This seems like the most elegant way of handling with this functionality. So let's assume a request comes in for some collection resource, sorted by date: |
Made some progress on collections. Basics are working, but I still need to:
|
I'll probably pick up sorting sometime later, but for now I'm happy with where I'm at. Closing this. |
Collections are (dynamic) lists of items that add pagination and sorting.
A few things that I'd want to be able to do:
https://atomicdata.dev/classes
and see all the classeshttps://atomicdata.dev/collections
and see a list of all collectionsatomic-cli new collection
- not requiring any programmingThe text was updated successfully, but these errors were encountered: