Thomas Waldmann committed 979b1e9

we don't need an extract backend for Trash/*, just complicates stuff and is rather pointless

copied from etherpad:

i just thought about renaming items, router, trash, etc.

the first idea was that a rename (saving a latest revision with different name
than revs before) could potentially move the whole item (all revs) to another backend.

e.g. if one renames Foo to Trash/Foo and Trash is routed to another backend.

but then i noticed that we do not need to do that. we can just store only that
(renamed) latest rev to the Trash backend and keep everything else where it is,
which is much simpler.

of course that is not quite the idea of a separate trashbin backend, one would
rather expect everything related to same item to free up space in content
backend and allocate space in trash backend when an item is trashed. so we can
as well give up having that separate Trash backend and just use the Trash/*
part of the namespace for the trash.

freeing up space in the content backend would then happen when the "trashbin"
is emptied, by some admin action "destroy all trash" or "destroy some specific
trash item", then all itemids relating to whatever has a trashed latest-rev
would be destroyed.

  • Participants
  • Parent commits 9c02e75

Comments (0)

Files changed (1)

File storage/

-CONTENT, USERPROFILES, TRASH = 'content', 'userprofiles', 'trash'
+CONTENT, USERPROFILES = 'content', 'userprofiles'
 BACKENDS_PACKAGE = 'storage.backends'
 def create_simple_mapping(uri='stores:fs:instance',
-                          content_acl=None, user_profile_acl=None, trash_acl=None):
+                          content_acl=None, user_profile_acl=None):
     When configuring storage, the admin needs to provide a namespace_mapping.
     To ease creation of such a mapping, this function provides sane defaults
     :params uri: '<backend_name>:<backend_uri>' (general form)
                  backend_name must be a backend module name (e.g. stores)
                  the backend_uri must have a %(nsname)s placeholder, it gets replaced
-                 by the CONTENT, USERPROFILES, TRASH strings and result is given to
+                 by the CONTENT, USERPROFILES strings and result is given to
                  to that backend's constructor
                  for the 'stores' backend, backend_uri looks like '<store_name>:<store_uri>'
         content_acl = dict(before=u'', default=u'All:read,write,create', after=u'', hierarchic=False)
     if not user_profile_acl:
         user_profile_acl = dict(before=u'All:', default=u'', after=u'', hierarchic=False)
-    if not trash_acl:
-        trash_acl = content_acl
     mounts_acls = {
         CONTENT: ('', content_acl),
-        TRASH: ('Trash', trash_acl),
         USERPROFILES: ('UserProfile', user_profile_acl),
     return create_mapping(uri, mounts_acls)