use most recent order on the homepage #3
Loading…
Reference in New Issue
No description provided.
Delete Branch "load-all"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
also loads all quotes (instead of just 10)
The choice to only load 10 quotes was intentional. I don't want to have a really long scrolling page.
That's fair. We should add pagination or another view that loads all.
/top currently loads all quotes in the db.
suggestion:
get_quotes_by_recent(limit=None)
, whereif limit is not None:
, add a"LIMIT "+limit
to the end of the query string, andORDER BY ID DESC
.get_quotes_by_recent(10)
.@app.route("/new")
that uses justget_quotes_by_recent()
.If you don't object, I'll do this on my own (in this branch).
I don't object to that. What do you think of pagination?
If you can figure out how to do pagination in SQL, then sure! Otherwise, we'll figure it out after I finish working on this.
Also, in case you're wondering why I'm insisting on the functions being seperate: when I start work on the API, I want to be able to at least have 1:1 functionality with the homepage. That's why I treat the pages as skins for the quotes: it just makes it easier to build an API.
Oh I didn't realize you were planning on adding an API :P
I legitimately just realized that something similar to this was in my workflow and just hadn't been committed yet. I like the idea we've come up with here more, though, so we'll go with this plan.
Are you thinking pagination then?
Looks like it wouldn't be too bad to do:
SO explanation here
sqlite wiki
there might already be an easy way to do this with the python sqlite library so that might be worth looking into as well
Alright, this LGTM!