1. 22 Mar, 2019 1 commit
  2. 30 Nov, 2017 1 commit
    • Denis Laxalde's avatar
      [ssplanner] Prevent execution of write queries involving computed relations · 68ca7fe0ca29
      Denis Laxalde authored
      Previously, setting a computed relation upon entity creation or
      modification (using the ORM or an RQL query) would usually fail with an
      operational error in the backend ("no such table"). However, under some
      mysterious circumstances (like passing a string as value in cw_set for a
      computed relation), the RQL to SQL transformation would simply drop the
      To prevent this to happen, we add a check for computed relation before
      adding a relation to an execution plan. This check raises a QueryError.
      It happens in several places:
      * in querier.InsertPlan.add_relation_def() (called from several places
        in ssplanner steps) for INSERT queries,
      * in ssplanner.UpdateStep.execute() for SET queries and,
      * in ssplanner.SSplanner.build_delete_plan() for DELETE queries.
      Tests added to unittest_querier.py because unittest_sslplanner.py looked
      inappropriate (it has only unit tests) and the former already had a
      NonRegressionTC class.
  3. 03 Nov, 2017 2 commits
  4. 15 Mar, 2017 1 commit
  5. 10 Mar, 2017 2 commits
  6. 05 Oct, 2016 1 commit
    • Sylvain Thénault's avatar
      [repository] Drop the entities.extid column and associated cache · 51c160677afe
      Sylvain Thénault authored
      This was not necessary anymore with promoted usage of the new data import API.
      Turn repository's _type_extid_cache to _type_cache with only the entity's type
      as key.
      This introduces an backward incompatible change: entity_metas dict doesn't
      contains anymore the extid key, but it doesn't seem used at all anywhere, so
      this sounds acceptable.
      Closes #15538317
  7. 11 Oct, 2016 1 commit
  8. 06 Oct, 2016 1 commit
  9. 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
  10. 20 May, 2016 1 commit
    • Sylvain Thénault's avatar
      [devtools] Simplify test configuration's init · 73ac69970047
      Sylvain Thénault authored
      Specify module's __file__ instead of apphome. __file__ is saved on the class as
      it will be used later (eg to find the proper pg cluster without relying on
      shared dictionnary modifications).
      This will require some tests update, but it should be less common in cubes than
      in cubicweb itself.
  11. 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
  12. 11 Jun, 2014 1 commit
  13. 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
  14. 28 Jan, 2014 1 commit
    • Aurelien Campeas's avatar
      [hooks/security] allow edition of attributes with permissive permissions · 7099bbd685aa
      Aurelien Campeas authored
      If an attribute has more permissive security rules than the entity
      type itself, we should be green and not deny action because of an
      early global entity permission check (with the more restrictive
      Only if one attribute with the entity-level permission rules is edited
      will the global check be performed.
      * the "if action == 'delete'" check at the entry of
        check_entity_attributes is a guard for a condition currently not
        happening in cubicweb itself (but application hooks could
        conceivably call this function with a 'delete' action)
      Closes #3489895.
      branch : stable
  15. 20 Dec, 2013 1 commit
    • Sylvain Thénault's avatar
      [rql2sql] remove special behaviour of symmetric relation vs DISTINCT · 54ead5f372bb
      Sylvain Thénault authored
      0542a85fe667 replacing SQL OR by hooks for symmetric relations allows that.
      This involve a single test value change for a border case: when querying a
      symmetric relation without specifying the subject nor the object, you may get
      some duplicated result. IMO this is fine to let the user explicitly use DISTINCT
      or not and to remove the dedicated handling we had which didn't let any choice.
      Related to #3259713
  16. 08 Jan, 2014 1 commit
    • Aurelien Campeas's avatar
      [schema] fix unique together index handling · 8e88576787c3
      Aurelien Campeas authored
      We now provide a more compact indexname, using the schema constraint
      entity type and the position of the columns set in the entity type
      unique constraints list.
      This avoids a nasty name truncation issue.
      The UniqueTogetherError object is made smarter: it computes the
      rtypes, abstracting the underlying backend (pg/sqlserver vs sqlite).
      The `user friendly` adapter is much simplified since there is no
      longer any truncation issue.
      Uses a new logilab.database version (ticket #151507) and a new yams
      version (ticket #189299)
      Closes #2514939
      [jcr: disable hooks when temporarily dropping CWUniqueTogetherConstraint entities]
  17. 03 Dec, 2013 1 commit
  18. 09 Oct, 2013 1 commit
  19. 29 Jan, 2014 1 commit
  20. 24 Oct, 2013 1 commit
  21. 31 Jul, 2013 1 commit
  22. 01 Jul, 2013 1 commit
  23. 22 Jan, 2014 1 commit
  24. 08 Apr, 2013 1 commit
  25. 28 Aug, 2014 1 commit
    • Lea Capgen's avatar
      [CWEP002] properly handle serialization of computed relations · 19a683a0047c
      Lea Capgen authored
      We now:
      * have CWComputedRelation in the bootstrap schema to store computed relations
      * properly serialize/deserialize it
      * test first if the database has been migrated and contains the related table
      Related to #3546717
      [jcr: adjust unittest_querier to pass with the added entity type]
  26. 14 Feb, 2013 1 commit
  27. 26 Nov, 2012 1 commit
  28. 10 Sep, 2012 1 commit
  29. 10 Apr, 2012 2 commits
  30. 05 Apr, 2012 1 commit
  31. 26 Mar, 2012 1 commit
  32. 16 Mar, 2012 1 commit
  33. 13 Feb, 2012 1 commit
  34. 12 Dec, 2011 1 commit
  35. 05 Dec, 2011 1 commit
  36. 25 Oct, 2011 2 commits