Improvement/pdp import data and button to export subjects table to excel
2 unresolved threads
2 unresolved threads
Compare changes
Files
48+ 4
− 1
@@ -294,7 +294,10 @@ def subjects(request, type):
It's look a bit hacky for me (I don't like -1 to be working as infinity :)). But keep it that way.
What I'm wondering is: if we have
length==-1
why we skipstart
parameter. Shouldn't we still returnordered_subjects[start:]
??I know it doesn't matter in this case but I would like to keep the API consistent.
When the datatables buttons are defined we need to set a value that would mean "all". The file is set like this:
lengthMenu: [[25, 50, 100, -1], [25, 50, 100, "All"]],
I think is intuitive that if select "All" in the menu, all the elements will be shown. I think is consistent, the
start
parameter will be ignored if -1length
is sent.But what is the point of sending parameter
start
at all then? (this is what goes to the API from the datatable)Okey, I looked it up and it seems the Datatable ajax receives a url which is then fulfilled with the parameters. In the end Datatable send a really long url with lots of parameters.
https://datatables.net/reference/api/