1. 09 Dec, 2015 1 commit
    • Julien Cristau's avatar
      Backout "[entity,storage] remove hackish code from the bfss path · dc572d116731
      Julien Cristau authored
      The merge of the repo-side and web-side entity caches doesn't actually work,
      because entities have a _cw attribute which is sometimes a connection and
      sometimes a web request, and whose nature changes not-really-predictably
      whenever ResultSet.get_entity() is called and brings it out of the cache.
      This reverts commit 59a79300f213.
  2. 18 Sep, 2015 1 commit
    • Rémi Cardona's avatar
      [server] Port BFSS to py3k · b261d90149d0
      Rémi Cardona authored
      The BFSS API changes in python 3:
      * 'defaultdir' MUST be a unicode object
      * 'fsencoding' MUST NOT be set
      In python 2, fsencoding handles both the encoding of file paths on the
      file system (utf-8 by default, but the system may actually be using
      something else) and the encoding of file paths that will be stored in
      the database.
      So in python 3, we wipe the slate clean:
      * rely on sys.getfilesystemencoding() to convert unicode objects to
      * always encode paths to utf-8 for storage in the database
      Caveat emptor / here be dragons:
      * sys.getfilesystemencoding() depends on the current locale, which
        therefore MUST be set properly
      * when migrating an existing instance from py2 to py3, one MAY need
        to reencode file paths stored in the database
  3. 11 Sep, 2015 1 commit
  4. 27 Jul, 2015 1 commit
  5. 23 Jun, 2014 1 commit
  6. 10 Jun, 2014 2 commits
    • Aurelien Campeas's avatar
      [entity,storage] remove hackish code from the bfss path · 59a79300f213
      Aurelien Campeas authored
      The ClientConnection/Connection duality brought some painful hacks
      that are no longer needed.
      Hence we can send entity._cw_update_attr_cache and ._cw_dont_cache_attribute
      to the grave.
      Related to #3837233
    • 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
  7. 23 Jan, 2014 1 commit
  8. 22 Jan, 2014 1 commit
  9. 23 Apr, 2013 1 commit
  10. 14 Feb, 2013 1 commit
  11. 23 Nov, 2012 1 commit
  12. 11 Sep, 2012 1 commit
  13. 07 Mar, 2012 1 commit
  14. 18 Jan, 2012 1 commit
  15. 03 Jan, 2012 1 commit
  16. 19 Dec, 2011 1 commit
  17. 26 Jul, 2011 1 commit
  18. 09 Jun, 2011 1 commit
  19. 30 May, 2011 1 commit
    • Pierre-Yves David's avatar
      [bfss] Make ``current_fs_path`` return None when an attribute has no value · 5e45e32071aa
      Pierre-Yves David authored
      current_fs_path was returning the future fspath when no value was defined.
      * This does not make any sense
      * This tricks the storage into believing that updating the attribute content is
        not necessary. The file was written but the attributes was not updated. as a
        result the assignement was not made.
      (close #1725446)
      branch : stable
  20. 19 May, 2011 1 commit
  21. 28 Mar, 2011 1 commit
  22. 08 Oct, 2010 1 commit
  23. 01 Oct, 2010 1 commit
  24. 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.
  25. 23 Jun, 2010 1 commit
  26. 09 Jun, 2010 1 commit
  27. 02 Jun, 2010 1 commit
  28. 28 May, 2010 1 commit
  29. 25 May, 2010 1 commit
  30. 20 May, 2010 1 commit
  31. 28 Apr, 2010 2 commits
  32. 23 Apr, 2010 3 commits
  33. 12 Apr, 2010 2 commits
    • Sylvain Thénault's avatar
      [storage] missing qrefresh in previous patch applied: fix comment, error... · 35d44017c72b
      Sylvain Thénault authored
      [storage] missing qrefresh in previous patch applied: fix comment, error message, and use a storage specified encoding, not cubicweb's encoding
      branch : stable
    • Pierre-Yves David's avatar
      [fix] fix path unicity process in BytesFileSystemStorage.new_fs_path · aebd00a2d316
      Pierre-Yves David authored
      The previous implementation was bugged (prefixing the whole path with '_'
      instead of the base name). A new version (using number) replace it.
      * * *
      Improve BytesFileSystemStorage.new_fs_path to use available metadata
      This version try to get some hint about how to name the file using metadata.
      Using the real file name and extension when available.  Keeping the extension
      might be usefull for exemple in the case of processing that use filename
      extension to detect content-type.
      branch : stable
  34. 08 Apr, 2010 1 commit
  35. 02 Apr, 2010 1 commit
    • Adrien Di Mascio's avatar
      [storages] fix fs_importing side-effect on entity.data · 88b5ca8da928
      Adrien Di Mascio authored
      When creating a new File object, if fs_importing is set,
      we want entity.data to be the file content instead of the
      filepath for the rest of the transaction.
      (see test_bfss_fs_importing_transparency) for test implementation
      To make this possible, the storage hooks (entity_added / entity_updated)
      must return the correct value to set in the entity dict.
      branch : stable