1. 17 Apr, 2018 1 commit
  2. 11 Apr, 2018 1 commit
  3. 09 Apr, 2018 2 commits
  4. 05 Apr, 2018 1 commit
  5. 30 Mar, 2018 4 commits
  6. 27 Mar, 2018 1 commit
    • Denis Laxalde's avatar
      Add a dedicated error view for cubicweb's RequestError · 1db2dd27c01e
      Denis Laxalde authored
      This view will be selected upon any exception which is a subclass of
      cubicweb.web.RequestError when the request has Accept:application/json.
      Previously, the "generic_error" view would have been called, but it
      cannot accurately handle CubicWeb's web exceptions (it always returns
      500, whereas these web exceptions may have a different status code).
      
      Why are these views selected? This is because the RootResource matches
      for any request with this Accept:application/json header. (In fact, we'd
      want to use this error view only when the request comes from a
      sub-resource of the RootResource; but that's not easy to achieve.)
      
      So this new error view convert a cubicweb.web.RequestError into an
      application/problem+json response. This is thus not backward compatible
      with what CubicWeb would return.
      
      In added test, we use the "format_date" "ajax" controller (of CubicWeb)
      with missing argument which then responds with a RemoteCallFailed (with
      a 500 status) that is called by our view.
      1db2dd27c01e
  7. 20 Mar, 2018 1 commit
    • Denis Laxalde's avatar
      Let yams_match respect Predicate.__call__ interface · ee7941762504
      Denis Laxalde authored
      CubicWeb's Predicate's __call__ method's interface is:
      
        def __call__(self, cls, req, **kwargs):
      
      In yams_match, we had 'rtype' and 'role' as non-keyword arguments, thus
      producing TypeError upon calls of a class's __select__ without all
      required arguments. We change this to have 'rtype' and 'role' option
      (though score will still be 0 if they are unspecified) so that we now
      respect base interface.
      ee7941762504
  8. 19 Mar, 2018 9 commits
  9. 16 Mar, 2018 4 commits
    • Denis Laxalde's avatar
      Export InlinedRelationItemMapper · b5a22b9b39cf
      Denis Laxalde authored
      It's probably not meant to be part of the public API but I need it
      downstream at the moment.
      b5a22b9b39cf
    • Denis Laxalde's avatar
      e7d22a6c2a56
    • Denis Laxalde's avatar
      Use the appropriate item mapper in RelationMapper.serialize() · cd3ba66cecb3
      Denis Laxalde authored
      Instead of duplicating the logic of serialization of items in this
      method, we now rely on a dedicate "jsonschema.item" mapper (properly
      selected with relation information) to serialize each item of the
      relation.
      cd3ba66cecb3
    • Denis Laxalde's avatar
      Let "relation" mappers serialize related entities directly · 3a0223d5a4d1
      Denis Laxalde authored
      Previously, the set of related entities was computed within
      "jsonschema.relation" mappers and their serialize() method accepted only
      the main "entity" from which this "related" set was computed. This is
      asymmetric with "jsonschema.collection" which serialize() method handles
      a list of entities. So we make the former mappers accept the set of
      related directly as an argument to their serialize() method. This set is
      computed by "jsonschema.entity" mapper.
      
      This is a step forward merging "jsonschema.relation" mappers (for
      non-final relation) with "jsonschema.collection" mappers.
      3a0223d5a4d1
  10. 15 Mar, 2018 8 commits
  11. 09 Mar, 2018 2 commits
  12. 01 Mar, 2018 3 commits
  13. 28 Feb, 2018 1 commit
    • Denis Laxalde's avatar
      Add an "in_state" property for workflowable entity · c412023a70a6
      Denis Laxalde authored
      We add an in_state (type: "string") property in the JSON instance and
      schema of workflowable entity type. This property is read-only as it
      does not match the underlying Yams schema (in which the target of
      "in_state" relation is a State entity). This is not a problem since we
      already have a way to manipulate the workflow state of entities through
      the dedicated "tag:cubicweb.org,2017:workflow-transitions" hyper-link.
      
      Closes #17135800.
      c412023a70a6
  14. 01 Mar, 2018 1 commit
    • Denis Laxalde's avatar
      Fix "role" parameter of find_relationship() overridden in loop · 18ab1b529afd
      Denis Laxalde authored
      Function find_relationship receives a "role" parameter but during the
      loop on relation definitions we were overriding it with an eponymous
      variable. Hence change loop variable name into "current_role".
      
      This got unnoticed because, most of the times, "role" from parameter and
      from loop would be the same. But for symmetric relation (an entity type
      being allowed as both subject and object), this breaks.
      18ab1b529afd
  15. 01 Feb, 2018 1 commit