1. 20 Mar, 2020 1 commit
    • Laurent Wouters's avatar
      [rql] Store selected variables for RQL select queries in ResultSet (#17218476) · 6eae252361e5
      Laurent Wouters authored
      By storing the name of the selected variables for RQL select queries in the
      ResultSet (within the "variables" attribute), the information can be passed
      down to specific protocols, e.g. rqlio that may wish to pass is down further
      to clients.
      In turn, clients can then choose to present the results of RQL select queries
      as symbolic bindings using the names used in the query's projection, instead of
      ordinal arrays.
  2. 05 Apr, 2019 1 commit
    • Denis Laxalde's avatar
      Drop python2 support · 26744ad37953
      Denis Laxalde authored
      This mostly consists in removing the dependency on "six" and updating
      the code to use only Python3 idioms.
      Notice that we previously used TemporaryDirectory from
      cubicweb.devtools.testlib for compatibility with Python2. We now
      directly import it from tempfile.
  3. 14 Mar, 2019 2 commits
    • Denis Laxalde's avatar
      Drop most of deprecated code · a8c1ea390400
      Denis Laxalde authored
      As in previous changesets, most code has been deprecated since a very
      long time. This changeset concerns "core" cubicweb modules
      (e.g. "server", "appobjects") for which it's not easy to handle change
      In cubicweb/server/querier.py, we adjust empty_rset() function as a
      result of "rqlst" argument of ResultSet being dropped. (There was no use
      of the keyword argument anyways.)
    • Laurent Peuch's avatar
      [DX] adding error messages to {ResultSet,ActionsRegistry}.possible_actions · c81e29cd8cff
      Laurent Peuch authored
      Try to make it more accessible, when we first encountered these errors
      it it didn't made any sense to us.
      branch : 3.26
  4. 24 Apr, 2018 1 commit
  5. 21 Sep, 2017 1 commit
  6. 03 Mar, 2017 1 commit
    • Sylvain Thénault's avatar
      [rset] Use RQL cache in syntax_tree method · 4bcb58aa103a
      Sylvain Thénault authored
      This avoid several unnecessary parsings per HTTP request, since in most case
      rset's rql is in the rql cache (since it has just been executed), while yapps
      based parsing is known to be slow.
  7. 30 Sep, 2016 1 commit
    • Sylvain Thénault's avatar
      flake8 and all · 432f87a63057
      Sylvain Thénault authored
      * update some copyright
      * drop most __docformat__ declaration
      * fix some flake8 warnings / errors
  8. 23 Nov, 2016 1 commit
    • Sylvain Thénault's avatar
      [views/optimization] Ensure we call rset.possible_actions with the same argument · ea1d92b677b5
      Sylvain Thénault authored
      rset.possible_actions (which should definitly not be an ResultSet method, but
      that's another story) has been designed to hold a cache to compute possible
      actions for a only once, since this may be a fairly costly operation (notably
      because of the 'has_editable_relations' predicates). But this has been broken by
      introduction of a new 'view' parameter which is not given by every call.
      To fix this, this cset adds the missing view argument where necessary and
      reimplements the rset's method to assert it's always called with the same key.
      Unfortunatly, those changes have to be ported to squareui and bootstrap cubes as
  9. 24 Nov, 2016 2 commits
  10. 29 Feb, 2016 1 commit
    • Julien Cristau's avatar
      [rset] fix infinite recursion introduced in c1eb5a676c80 · b81e543e623a
      Julien Cristau authored
      The mechanism to avoid loops in c1eb5a676c80 "[rset] Always complete
      attribute/relation caches in ResultSet.get_entity" breaks down: we would
      loop forever if two entities that were already in the cache were linked
      by a relation with ? or 1 cardinality in both directions.  To avoid
      that, keep a set of already-considered columns.  Related to #9942503.
  11. 12 Jan, 2016 2 commits
    • Alexandre Richardson's avatar
      [rset] Always complete attribute/relation caches in ResultSet.get_entity · c1eb5a676c80
      Alexandre Richardson authored
      RQL queries are often designed to fill up the ORM's caches when fetching
      entities out of the result set.  Until now, if an entry already existed
      in the entity cache, ResultSet.get_entity would return it unchanged,
      not using the new ResultSet's contents to update the attribute cache,
      breaking expectations (if the attributes are needed, they'd then be
      fetched later one at a time, one entity at a time), resulting in loads
      of DB accesses.
      So we change ResultSet.get_entity so that:
      * if the entity is already cached and has been instantiated from the
        same rset, it is returned as-is (to avoid loops)
      * if the entity is not yet cached, it is instantiated
      * if the entity is cached via another rset, its attribute/relation
        caches are completed
      Closes #9942503
    • Alexandre Richardson's avatar
      [rset] refactoring of _build_entity method · dfa5f8879e8f
      Alexandre Richardson authored
      define a method for entity instantiation and storage in cache
      (related to #9942503)
  12. 16 Jan, 2016 1 commit
    • Denis Laxalde's avatar
      Reorganize source tree to have a "cubicweb" top-level package · 0b59724cb3f2
      Denis Laxalde authored
      mkdir cubicweb
      hg mv *.py -X setup.py cubicweb
      hg mv dataimport devtools entities etwist ext hooks i18n misc schemas server skeleton sobjects test web wsgi cubicweb
      Other changes:
      * adjust path to cubicweb-ctl in devtools tests
      * update setup.py to avoid importing __pkginfo__ (exec it instead),
        replace os.path.walk by os.walk and prepend `modname` here and there
      * update tox.ini to account for new test locations
      * update doc/conf.py so that it still finds __pkginfo__.py and CWDIR in
  13. 24 Apr, 2014 1 commit
  14. 10 Jun, 2014 1 commit
    • Aurelien Campeas's avatar
      [repoapi] fold ClientConnection into Connection · 635cfac73d28
      Aurelien Campeas authored
      Connection replaces ClientConnection everywhere.
      Some notes:
      * testlib: .client_cnx and .repo_cnx become aliases of .cnx (we might
        not want to tell people to update their tests again for just no real
        benefit, so we'll live with these aliases for a while)
      * entity.as_rset must not be cached because we risk caching result
        sets having a Connection object as .req (helps unittest_breadcrumbs)
      * entity._cw_dont_cache_attributes loses its repo/request special
        paths and only keeps its storage/bfss user (this helps
      * moreover, entity.cw_instantiate and .cw_set stop overriding the
        attributes cache *after* the before_*_entity hooks have run, because
        there is no need to (it is now actually harmful to do it and
        unittest_hooks.test_html_tidy* tests remain green because of this)
      * rset._build_entity sticks its .req onto the entity just fetched from
        the cache, because otherwise it might carry a _cw that is a
        Connection object where a Request is expected (helps
      * we get overall better cache usages (entity caches were split over
        Request + ClientConnection and Connection), hence the changes
        unittest_entity and unittest_wfobjs
      * void the ecache when providing the cnx to a request object
        Having the entity cache pre-filled when we bind it to the request
        object hurts because these entities are bound to Connection objects,
        that lack e.g. `.form` or `.add_js` and crash the views subsystem.
        Thus, the unittest_testlib.test_error_raised test will are kept
      Closes #3837233
  15. 01 Dec, 2014 1 commit
  16. 27 Jul, 2014 1 commit
  17. 11 Dec, 2013 1 commit
    • Christophe de Vienne's avatar
      [rset] New method: ResultSet.one() · bd841d6ae723
      Christophe de Vienne authored
      This method will return exactly one entity while enforcing its existence and unicity.
      The idea is shamelessly borowed from SQLAlchemy Query.one().
      Closes #3352314
      [jcr: use len(self) instead of len(self.rows)]
  18. 03 Dec, 2013 1 commit
  19. 09 Oct, 2013 1 commit
  20. 27 May, 2014 1 commit
    • Aurelien Campeas's avatar
      [rset] kill the rset._rqlst cache · ed0b076c119b
      Aurelien Campeas authored
      Right now it "works" for the standard, internal uses.
      However when we will fold ClientConnection and Connection, it will
      hurt, because suddenly we get more cache hits, and the following
      situation would become commonplace:
      * there is an un-annotated _rqlst given by the querier
      * some view (e.g. facets) requests the .syntax_tree, which takes a
        copy of _rqlst
      * the view actually expects the rql syntax tree to be annotated, but
        it was not, hence we crash.
      Related to #3837233.
  21. 14 Feb, 2013 1 commit
  22. 16 Nov, 2011 1 commit
  23. 03 Nov, 2011 1 commit
  24. 18 Oct, 2011 1 commit
  25. 01 Jul, 2011 1 commit
  26. 19 May, 2011 1 commit
  27. 29 Apr, 2011 1 commit
    • Adrien Di Mascio's avatar
      [optim] cache rset column structures · 39437617f3f0
      Adrien Di Mascio authored
      When iterating over large resultsets (lot of colcumns, lot of lines)
      to build entities, caching column structure (which attribute or relation
      is stored in each column) can improve performance noticeably.
  28. 28 Jan, 2011 1 commit
  29. 20 Jan, 2011 1 commit
  30. 19 Jan, 2011 1 commit
  31. 09 Sep, 2010 2 commits
  32. 25 Aug, 2010 1 commit
    • Sylvain Thénault's avatar
      [session] cleanup hook / operation / entity edition api · 8bc6eac1fac1
      Sylvain Thénault authored
      Operation api
      * commit_event killed, recently introduced postcommit_event is enough and has a better name
      * kill SingleOperation class, it's a) currently never used b) superseeded by set_operation if needed.
      Entity edition api
      edited_attributes turned into a special object holding edition specific attributes:
      - attributes to be edited (simply mirrored in cw_attr_cache, actual values are there)
      - former _cw_skip_security set (cw_edited) and querier_pending_relations
      It has also been renamed to `cw_edited` on the way (it may also contains inlined relations)
      The entity dict interface has been deprecated. One should explicitly use either
      cw_attr_cache or cw_edited according to the need.
      Also, there is now a control that we don't try to hi-jack edited attributes
      once this has no more effect (eg modification have already been saved)
      At last, _cw_set_defaults/cw_check internal methods have been moved to this
      special object
      Hook api
      hook.entity_oldnewvalue function now moved to a method of cw_edited object.
  33. 14 Jun, 2010 1 commit
  34. 11 Jun, 2010 1 commit
  35. 04 Jun, 2010 2 commits