# HG changeset patch # User Sylvain Thénault # Date 1253104404 -7200 # Node ID 9e4adca73a955da924f134e01d77631bd8e130f0 # Parent 7ef021ac8dec2bbb50bcc7c7363ed5218cd269f1 stop setting sort to false by default on relation field and explain why diff -r 7ef021ac8dec -r 9e4adca73a95 web/formfields.py --- a/web/formfields.py Wed Sep 16 14:32:56 2009 +0200 +++ b/web/formfields.py Wed Sep 16 14:33:24 2009 +0200 @@ -438,9 +438,16 @@ class RelationField(Field): - def __init__(self, **kwargs): - kwargs.setdefault('sort', False) - super(RelationField, self).__init__(**kwargs) + # XXX (syt): iirc, we originaly don't sort relation vocabulary since we want + # to let entity.unrelated_rql control this, usually to get most recently + # modified entities in the select box instead of by alphabetical order. Now, + # we first use unrelated_rql to get the vocabulary, which may be limited + # (hence we get the latest modified entities) and we can sort here for + # better readability + # + # def __init__(self, **kwargs): + # kwargs.setdefault('sort', False) + # super(RelationField, self).__init__(**kwargs) @staticmethod def fromcardinality(card, **kwargs):