Introduit dans la version 1.2.
Module to select which files should be deleted (physically removed) after:
- a checkin of a DocumentFile
- a deletion of a DocumentFile
- a cancellation of a Document
- a deprecation of a Document
Each case can have a different behaviour specified by:
These constants are lists of tuples (test, selector) where:
- test is a function that takes a DocumentFile and returns True if selector applies to the given file
- selector is an instance of Selector which returns a list of DocumentFile to be deleted.
They can be given to get_deletable_files() to retrieve the list of DocumentFile to delete.
Bases: plmapp.files.deletable.Selector
A selector which keeps only the last count revisions (last one include).
Bases: plmapp.files.deletable.Selector
A selector which keeps all files: get_deletable_files() always returns an empty list.
Bases: plmapp.files.deletable.Selector
A selector which returns all undeleted files.
If include_last_revision is True, the given document file is also included in the returned list.
Bases: plmapp.files.deletable.Selector
A selector which ensures that the size of files related to a revision does not exceed max_size.
Paramètres: |
|
---|
Possible values for order are:
- revision
- first deletes the most recent revisions
- -revision
- first deletes the oldest revisions
- size
- first deletes the biggest files
- -size
- first deletes the smallest files
Bases: plmapp.files.deletable.Selector
A selector which keeps at most maximum per frequency (day, month, year).
If the number of revisions exceeds maximum, most recent revisions are first deleted.
Bases: plmapp.files.deletable.Selector
A selector which only keeps revisions if the revision modulo number equals to modulo.
For example, Modulo(4, 1) keeps a revision of four, and the intial revision is kept.
Bases: plmapp.files.deletable.Selector
A selector which deletes too frequent updates.
A revision is deleted if the difference between the date of creation of the last revision and its creation time is lesser than timedelta (a datetime.timedelta object).
If incremental is True (the default), only the previous revision is tested. This behaviour should be used after a checkin.
Returns a function which takes a DocumentFile and returns True if its filename matches one of the given patterns (like *.txt). patterns are not case sensitive.
Returns the list of DocumentFile to delete.
Returns an empty list if settings.KEEP_ALL_FILES is True.
Paramètres: |
|
---|
default selectors called after a checkin
default selectors called after a deletion
default selectors called after a deprecation
default selectors called after a cancellation