Versionned attachment for AnyBlok
Improve AnyBlok to add attachment and report system.
|attachment||Stock and historize Document|
|report||attachment||Core of the reporting engine for AnyBlok. This blok add helper to generate a Document, but it is not a templating engine.|
|report-format||attachment report||Simple templating engine, based on str.format(...)|
|wkhtml2pdf||attachment report||Add Model add method to convert HTML 2 PDF.|
AnyBlok / Attachment is released under the terms of the Mozilla Public License.
See the latest documentation
Information about the AnyBlok / Attachment project.
Releases and project status are available on Pypi at http://pypi.python.org/pypi/anyblok_attachment.
The most recent published version of this documentation should be at http://doc.anyblok-attachment.anyblok.org.
AnyBlok with attachment is currently in beta status and is expected to be fairly stable. Users should take care to report bugs and missing features on an as-needed basis. It should be expected that the development version may be required for proper implementation of recently repaired issues in between releases;
Install released versions of AnyBlok from the Python package index with pip or a similar tool:
pip install anyblok_attachment
Installation via source distribution is via the setup.py script:
python setup.py install
Installation will add the anyblok commands to the environment.
Run the test with nose:
pip install nose nosetests anyblok_attachment/tests
AnyBlok / Attachment works with Python 3.3 and later. The install process will ensure that AnyBlok is installed, in addition to other dependencies. The latest version of them is strongly recommended.
Bugs and feature enhancements to AnyBlok should be reported on the Issue tracker.
- Removed the sequence created by the document. Replaced it by a simple counter on latest document
You can use this script before migration to update the database:
CREATE FUNCTION update_attachment() RETURNS void AS $$ DECLARE -- declarations target RECORD; BEGIN FOR target IN select uuid, version from attachment_document where version_number is null LOOP UPDATE attachment_document SET version_number = CAST(substring(target.version from '..$') as Integer) WHERE uuid = target.uuid AND version = target.version; END LOOP; END; $$ LANGUAGE plpgsql; CREATE FUNCTION update_sequence() RETURNS void AS $$ DECLARE -- declarations seq RECORD; BEGIN FOR seq IN select id, seq_name from system_sequence where code ilike 'Attachment.Document#%' LOOP EXECUTE 'DROP SEQUENCE ' || quote_ident(seq.seq_name); DELETE FROM system_sequence where id = seq.id; END LOOP; END; $$ LANGUAGE plpgsql; ALTER TABLE attachment_document DROP CONSTRAINT anyblok_pk_attachment_document; ALTER TABLE attachment_document ADD COLUMN version_number INTEGER; select update_attachment(); select update_sequence(); ALTER TABLE attachment_document ADD PRIMARY KEY (uuid, version_number); UPDATE system_blok SET installed_version = '2.0.0' WHERE name = 'attachment'; DROP FUNCTION update_attachment(); DROP FUNCTION update_sequence();
- Allow to get another field to represent the file
- PR #4: Added a column name on the template to identify them easyly (@GohuHQ)
- PR #3: Fixed option name for wkhtmltopdf (@GohuHQ)
- Fix the mixins come from anyblok_mixins
- [ADD] add Mixin Mixin.LatestDocument and Mixin.VersionedDocument to help the developer to get latest_document or versioned_document
- [REF] Anyblok 0.17.0 changed setter to add application and application groups, So I had to adapt the existing to use new setter
- [FIX] Mixin.WkHtml2Pdf check also if the configuration changed for Template.check_if_file_must_be_generated
- [ADD] attachment blok: stock versionned file
- [ADD] report blok: create versionned file from template
- [ADD] report-format blok: template type
- [ADD] wkhtml2pdf blok: convert html to pdf in the template
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size & hash||File type||Python version||Upload date|
|anyblok_attachment-2.0.0-py3-none-any.whl (49.5 kB) View hashes||Wheel||3.5|
|anyblok_attachment-2.0.0.tar.gz (21.1 kB) View hashes||Source||None|
Hashes for anyblok_attachment-2.0.0-py3-none-any.whl