Re: Some questions about file handling + some other things
Ralf Schlatterbeck <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Mar 24, 2021 at 01:20:43PM -0400, John P. Rouillard wrote:
>
> https://issues.roundup-tracker.org/issue772935 changed sorting
> from len(multilink) to sort by contents back in 0.6 to fix grouping.
> Before then multilinks with the same content but only one item didn't
> sort together breaking grouping.
>
> So (stable) Multilink sorting is also required for grouping by
> multilinks.
Yep, the current code sorts as much as possible in SQL and then the rest
in python, it relies on pythons sort being stable.
> then I sort the lists getting:
>
> issue nosy_list
>
> 3 [4,5,6]
> 1 [4,6]
> 2 [6,5]
>
> Correct?
Yes.
> I would be ok with:
>
> setkey(['name','phone'])
>
> then require labelprop be set to a property name
>
> setlabelprop("labelname")
In many cases, especially when the key property has multiple columns,
this would be ambiguous.
> or a function that gets the values of the properties listed in setkey:
>
> setlabelprop(lambda l: l.join("@"))
>
> Alternatively:
>
> setlabelprop("{name} at {phone}")
>
> Since '{' can't be in a property name you can distinguish a format
> string from a property name.
That looks nice.
For the join I'd by default take ', ' as the separator, not '@' or ' '
and it would be reversed, '@'.join(l)? Optionally a labelprop with a
format string could be given as you suggest.
> Orderprop as an array would sort by the first value and when the first
> values compare equal sort by the second value.
>
> orderprop(['name', 'phone'])
Yes.
> are ordered as above. Maybe we need tuples there to control sort order?
I don't think so, the default order is only used in drop-down. When
you're querying via the web-interface we already support sorting and
grouping by multiple attributes. I don't know if the default template
supports this, though.
Ralf
--
Dr. Ralf Schlatterbeck Tel: +43/2243/26465-16
Open Source Consulting www: www.runtux.com
Reichergasse 131, A-3411 Weidling email: [email protected]