Re: Some questions about file handling + some other things
"John P. Rouillard" <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Ralf: In message <[email protected]>, Ralf Schlatterbeck writes: >On Wed, Mar 24, 2021 at 12:55:12AM +0100, Nagy Gabor wrote: >> 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. > >Sorting by Multilink happens in Python not in SQL. What is your use-case >for sorting by Multilink? In my experience the sort order created by >this is hardly understandable by humans. I don't think this is sorting by multilink but sorting the items in a multilink. At least thats how I read cgi/templating.py: MultilinkHTMLProperty::sorted(). >I would like to deprecate its use. IIRC there was either a bug report or email thread about sorting by multilinks (as opposed to sorting the elements of a multilink). The original design doc calls for sorting by len(multilink) IIRC. I don't know what sorting by the multilink prop does currently. I'll have to see if I cand dredge it up. IIRC we came up with a use case for this which was saner than the current sorting method. >I also at one time wanted to implement key properties with multiple >values: An application often demands uniqueness over several properties >not just one. I discussed this *many* years ago with Richard but he >feared at the time that things would be complicated by this. I still >think it would be a useful feature. I would tend to agree it's useful. Maybe a key() function that is passed the item? Could be materialized in a _key hidden/reserved property name similar to creator/activity.... >> 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. > >Yes, this can be done in an explicit index template if you really need >that behavior. Do you have an example? I envision some sort of concatenation of id's that result from a search that are sent into request/batch somehow. -- -- rouilj John Rouillard =========================================================================== My employers don't acknowledge my existence much less my opinions.