1
1 Comment

Newbie looking to learn about paginating databases... I think?

https://cryptojobslist.com/

Newbie looking to learn about paginating databases... I think?

Hey Squad, I'm just looking for help learning the names of what this topic would even be called so I can go out and educate myself.

You can see on a website like this: https://cryptojobslist.com/
There's a Heading for 'Today', 'Yesterday', and 'Earlier Jobs.'

I'm wondering how, on the backend, I can achieve this. In my database, every day I make an API call out to refresh the data. How can I make the old data move to the "Yesterday" jobs and then eventually the "Earlier Jobs" ? How do I go about learning this?

I hope this makes sense... Thank you in advance for your help

submitted this linkon February 9, 2019
  1. 1

    For each job in your database, have a date field storing the date it was added.
    When showing a list of jobs, you would fetch a list of X most recent jobs from your database. You would also want to group them into the "today", "yesterday" and "earlier" buckets. You could do that in the database query, in your backend framework's view function or even in the template logic.