TG 1.0.5 should not produce such complicated URLs any more. Did you
create this manually?
-- Christoph
That's true. Just to make clearer what is happening: Sometimes paginate
cannot order a query using an SQL "order by" clause. This can happen
when the underlying data is not created by an SQL query or is using an
attribute that is e.g. a property of the ORM class which does not exist
in the corresponding database table. And, as in your case, this can also
happen when a malicous or invalid old query parameter is used. In this
case, when ordering via SQL is not possible, paginate tries to sort in
memory. Actually this is a very convenient thing, but where you are
dealing with datasets of hundred thousands of items, as in your case,
this is indeed counterproductive and could be used for DOS attacks.
To fix this, I think we need to introduce another paginate parameter,
e.g. "sort_limit" that would give an upper limit for rows that is
allowed to be fetched and sorted in memory. The default value could be
something like 100*limit (i.e. 100 pages of data).
There is a simialr problem with the "_tgp_limit" query parameter. If
"allow_limit_override" is set, then you can also query the whole
dataset. Though "allow_limit_override" is false by default, you often
want to allow users to choose a limit (e.g. 10, 20 or 50 datasets).
So I suggest adding a parameter "max_limit" for the maximum number of
rows a user can request per page. If set to 0, False or None, this could
be interpreted as "don't allow changing the number of rows per page."
The "allow_limit_override" could then be deprecated.
-- Christoph
Yes, but now the milk is already spilt and we need to fix these things.
Adding these safety mechanisms should be considered a bugfix.
If you file a ticket, I'll take care of it and fix it as suggested if
there are no better ideas.
-- Christoph
Yes, but now the milk is already spilt and we need to fix these things.
Adding these safety mechanisms should be considered a bugfix.
If you file a ticket, I'll take care of it and fix it as suggested if
there are no better ideas.
-- Christoph