Skip to main content

MgClipboard

Clipboard middleware for Papermerge DMS. Designed as Django reusable app.

Installation

Install it using pip::

pip install mgclipboard

Add app to INSTALLED_APPS in settings.py:

INSTALLED_APP = (
...
'mgclipboard',
...
)

Add it to MIDDLEWARE list:

MIDDLEWARE = [
    ...
    # AFTER
    # * django.contrib.sessions.middleware
    # * django.contrib.auth.middleware
    'mgclipboard.middleware.ClipboardMiddleware'
    ...
]

mgclipboard.middleware is dependent on django.contrib.sessions and django.contrib.auth middleware. Thus, dependencies must be included first in MIDDLEWARE list.

Usage

MgClipboard middleware adds 3 attributes to the request object:

  • request.clipboard
  • request.nodes (shortcut for request.clipboard.nodes)
  • request.pages (shortcut for request.clipboard.pages)

To add list of node ids to clipboard use:

request.nodes.add(['id1', 'id2', ...])

To retrieve all node ids (folder or documents) currently in the clipboard call:

request.nodes.all()

To clear all nodes data from the clipboard:

request.nodes.clear()

To add pages, all belonging to same document, use:

request.pages.add(
    doc_id=doc_id,
    page_nums=[1, 2, 3]
)

Important! page_nums is a list of page numbers within document doc_id. Page numbering starts with 1.

All pages currently in clipboard are returned by:

request.pages.all()

To clear all pages data from the clipboard:

request.pages.clear()

Metadata

Release files for mgclipboard 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mgclipboard 0.3.0
File Size Uploaded Provenance
mgclipboard-0.3.0.tar.gz 3.3 kB Without provenance Details

Release files / mgclipboard-0.3.0.tar.gz

Download URL mgclipboard-0.3.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1da1a39b3745e75462ea200835371de3b20b33681acef22daf4117806ad0c3aa
BLAKE2b-256 checksum
How to use checksums
feec5c72f894801b1648a22dd6c734f7d6cb428d9a024e459f89ae0dfe0d0a33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

Security for mgclipboard 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page