doc/book/en/development/entityclasses/load-sort.rst
branchstable
changeset 2172 cf8f9180e63e
parent 1714 a721966779be
child 2539 0f26a76b0348
equal deleted inserted replaced
2125:19861294506f 2172:cf8f9180e63e
    12   to use in the requirement `ORDER BY` of an RQL query to automatically
    12   to use in the requirement `ORDER BY` of an RQL query to automatically
    13   sort the list of entities of such type according to this attribute, or
    13   sort the list of entities of such type according to this attribute, or
    14   `None` if we do not want to sort on the attribute given in the parameter.
    14   `None` if we do not want to sort on the attribute given in the parameter.
    15   By default, the entities are sorted according to their creation date.
    15   By default, the entities are sorted according to their creation date.
    16 
    16 
    17 * The class method `fetch_unrelated_order(attr, var)` is similar to the 
    17 * The class method `fetch_unrelated_order(attr, var)` is similar to the
    18   method `fetch_order` except that it is essentially used to control
    18   method `fetch_order` except that it is essentially used to control
    19   the sorting of drop-down lists enabling relations creation in 
    19   the sorting of drop-down lists enabling relations creation in
    20   the editing view of an entity.
    20   the editing view of an entity.
    21 
    21 
    22 The function `fetch_config(fetchattrs, mainattr=None)` simplifies the
    22 The function `fetch_config(fetchattrs, mainattr=None)` simplifies the
    23 definition of the attributes to load and the sorting by returning a 
    23 definition of the attributes to load and the sorting by returning a
    24 list of attributes to pre-load (considering automatically the attributes
    24 list of attributes to pre-load (considering automatically the attributes
    25 of `AnyEntity`) and a sorting function based on the main attribute
    25 of `AnyEntity`) and a sorting function based on the main attribute
    26 (the second parameter if specified otherwisethe first attribute from
    26 (the second parameter if specified otherwisethe first attribute from
    27 the list `fetchattrs`).
    27 the list `fetchattrs`).
    28 This function is defined in `cubicweb.entities`.
    28 This function is defined in `cubicweb.entities`.