doc/3.14.rst
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 26 Sep 2011 18:03:38 +0200
changeset 7859 15809afe093b
parent 7828 749e1a67987f
child 7875 65e460690139
permissions -rw-r--r--
[migration doc] talk about changes in Entity.fetch_rql

API changes in cubicweb 3.14
----------------------------

* `Entity.fetch_rql` `restriction` argument has been deprecated and should be
  replaced with a call to the new `Entity.fetch_rqlst` method, get the returned
  value (a rql `Select` node) and use the RQL syntax tree API to include the
  above-mentionned restrictions.

  Backward compat is kept with proper warning.

* `Entity.fetch_order` and `Entity.fetch_unrelated_order` class methods have been
  replaced by `Entity.cw_fetch_order` and `Entity.cw_fetch_unrelated_order` with
  a different prototype:

  - instead of taking (attr, var) as two string argument, they now take (select,
    attr, var) where select is the rql syntax tree beinx constructed and var the
    variable *node*.

  - instead of returning some string to be inserted in the ORDERBY clause, it has
    to modify the syntax tree

  Backward compat is kept with proper warning, BESIDE cases below:

  - custom order method return **something else the a variable name with or
    without the sorting order** (e.g. cases where you sort on the value of a
    registered procedure as it was done in the tracker for instance). In such
    case, an error is logged telling that this sorting is ignored until API
    upgrade.

  - client code use direct access to one of those methods on an entity (no code
    known to do that)

* `Entity._rest_attr_info` class method has been renamed to
  `Entity.cw_rest_attr_info`

  No backward compat yet since this is a protected method an no code is known to
  use it outside cubicweb itself.