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 Thu, Mar 25, 2021 at 02:49:31AM +0100, Nagy Gabor wrote:
> > 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.
>
> From John's email I realised that 'filetype' was not the correct
> example here. (As you probably noticed, my English is far from perfect.)
> I did not mean mime-type (which is called 'type' in Roundup), but
> something like category of files (like "copy of diploma", for example),
> and in my real tracker it is context.documents.sorted('...').
>
> I wanted to use this to group the files (=documents) of a task item
> by their 'filetype' (=category), similarly to a Class' index view: First
> list documents with type "copy of diploma", then ... And since
> 'filetype' is a user-editable (sorted) list, I do not want to hard-code
> it to my html template.
>
> > I would like to deprecate its use.
>
> I am fine with that, too. As I said in my reply to John's email, it can
> be easily replaced by Python's sorted() function (by accessing _value).
Hmm, we're talking about two different things here: I was talking about
the sort order of a query using filter, you are talking about the
default order of a single multilink when retrieved via the html layer.
The thing I wanted to deprecate is the ordering by multilink properties
in filter. This sorting is done in python and is slow. In addition it is
hardly comprehensible by humans :-) John has an example in a recent mail
on this topic.
Concerning the default ordering of your documents multilink: You can
specify an order property on the filetype (category). But as pointed
out, the order property currently can only be a single property, not a
list of properties which might be needed in your case.
> > > Second, this method does not seem to respect the data type of the
> > > 'order' property of 'filetype' class.
> >
> > This is definitely worth a bug-report, especially if this also applies
> > to sorting by non-multilinks.
> > I *think* we currently allow only strings as key- order- and label
> > properties. This should probably change.
>
> If this is the case, then I should quickly modify my schema.py soon,
> because my schema.py is full of order=Integer(). :) So I am happy that
> I brought this up.
Yes.
Ralf
--
Dr. Ralf Schlatterbeck Tel: +43/2243/26465-16
Open Source Consulting www: www.runtux.com
Reichergasse 131, A-3411 Weidling email: [email protected]