Re: Some questions about file handling + some other things
Nagy Gabor <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <20210325161236.15bf5260@Dell> |
> 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.
Oh, I see. My only comment on this is that I do not need this feature
(at the moment), but I would keep it, if it works.
> 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.
Bad news, I prefer numbers for ordering. :) Then I will switch to "001"
, "002", ...
Btw, John's tracker roundup-sysadmin also contains order=Integer() in
its schema.py. Until playing with .sorted(), everything worked for me as
expected with Integer() order class.
Gábor
_______________________________________________
Roundup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/roundup-users