|
From: Nagy G. <gab...@gm...> - 2021-03-23 23:55:28
|
> On Tue, Mar 23, 2021 at 08:06:57AM +0100, Ralf Schlatterbeck wrote:
> > So if you have an end-date and you're searching for all items
> > that have either an empty end-date or None you would use ';.,-' as
> > the query string .-)
>
> That should have read "searching for all items that have either an
> empty end-date or one in the future". And the query I've given as an
> example searches in the past, so the correct query string (I hope)
> would be '.;,-'
>
> Ralf
Dear Ralf,
Thank you for the explanation on dates and intervals.
(Do you mean "... or one in the past"?)
One more question on Dates. The dates must be submitted in
html form variables in the standard date format 2021-03-24.14:00,
right? There are methods for printing dates in alternative format (like
pretty()), but it seems to me that the date submitted to Roundup must
be in this format. And I guess if my users want a different date format,
then I have to do the conversions on my own.
And some additional comments I've run into this weekend:
The sorted method of Multilink properties (provided by the cgi engine),
does not always work as expected. First, I got Python error on
context.files.sorted('filetype'), when the 'files' list had an item
with 'filetype' unset.
Second, this method does not seem to respect the data type of the
'order' property of 'filetype' class. It was set to Integer in my
schema.py for the 'filetype' class, but sorted() treated it as a string.
It took a while until I realised that the reason for unexpected sorting
is "12" < "2", for example. :)
Finally, one more minor question. Assume that I want to sort notclosed
tasks by 'deadline' in increasing order (which seems reasonable). In
this case the first tasks will be those for which deadline is unset.
But what if I want to put them to the end of the list? How this can be
done? (First try: I won't allow unset deadline, it is 9999-12-31 behind
the scenes. Second try: I do two database query for tasks (the first
one filters on 'deadline is set', and an other one filters on 'deadline
is not set', and join these list. But this is just an example, I am more
interested in how these filter/sort cgi request can be customized, or
the obtained "batch list" modified?)
Thank you all for the useful information.
Regards,
Gábor
|