1. 16 Mar, 2018 1 commit
    • 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.
  2. 15 Mar, 2018 8 commits
  3. 09 Mar, 2018 2 commits
  4. 01 Mar, 2018 3 commits
  5. 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.
  6. 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.
  7. 01 Feb, 2018 2 commits
  8. 29 Jan, 2018 2 commits
    • Denis Laxalde's avatar
      Merge with 0.2 · 81cfc97a4f14
      Denis Laxalde authored
      Apart from resolving merge conflict, the
      CompoundMapperTC:test_object_relation test had to be almost entirely
      rewritten because tests' schema changed in "default" branch ("author"
      relation semantics changed in cdff71d0dd27, we thus now use "in_library"
      instead) and because the rendering of array items is now different
      (items are objects with a "id" property instead of plain strings
    • Denis Laxalde's avatar
      Add a doc-requirements.txt file · fb6f75047ecb
      Denis Laxalde authored
      This will be useful on readthedocs.
  9. 26 Jan, 2018 1 commit
  10. 15 Jan, 2018 1 commit
  11. 12 Dec, 2017 8 commits
  12. 11 Dec, 2017 4 commits
  13. 08 Dec, 2017 3 commits
  14. 11 Dec, 2017 1 commit
    • Denis Laxalde's avatar
      Add JSON and JSON Schema views for entities' workflow transitions · 4bf8a69fed72
      Denis Laxalde authored
      We associate the proper 'jsonschema.collection' mapper from the
      WorkflowTransitionsResource resource by implementing the mapper()
      Most added views are straightforward except the
      post_entity_workflow_transition which handles adapter.fire_transition()
      call directly (instead of passing through mapper.values()) since, as
      noted in previous changeset we diverge from the actual implementation of
      workflows in CubicWeb to expose a simpler REST API.
      See functional tests for how it works.
  15. 06 Dec, 2017 1 commit
  16. 08 Dec, 2017 1 commit
    • Denis Laxalde's avatar
      Add mappers for "workflow objects" · 8eda96bb89ab
      Denis Laxalde authored
      We add two mappers corresponding to the TrInfo entity type:
      * TrInfoEntityMapper is used for JSON Schema generation with "creation"
        role; this schema is different from what the normal mapper would
        produce in that it exposes the "name" of the transition directly and
        hides the implementation details of CubicWeb's workflows (which is a
        state machine not really needed in the framework of a REST API).
      * TrInfoCollectionMapper is a collection mapper that only supports
        serialization and produces the array of transitions fired for the
        entity given in context.