Package: anyblok_attachment
AnyBlok attachmentImproveAnyBlokto add attachment and report
system.BlokDependanciesDescriptionattachmentStock and historize DocumentreportattachmentCore of the reporting engine for AnyBlok. This blok
add helper to generate a Document, but it is not a
templating engine.report-formatattachmentreportSimple templating engine, based onstr.format(...)wkhtml2pdfattachmentreportAdd Model add method to convert HTML 2 PDF.attachment-postgresattachmentAdd Model add method to convert HTML 2 PDF.AnyBlok / Attachment is released under the terms of theMozilla Public License.See thelatest documentationFront MatterInformation about the AnyBlok / Attachment project.Project HomepageAnyBlok is hosted ongithub- the main project
page is athttps://github.com/AnyBlok/anyblok_attachment. Source code is
tracked here usingGIT.Releases and project status are available on Pypi athttp://pypi.python.org/pypi/anyblok_attachment.The most recent published version of this documentation should be athttp://doc.anyblok-attachment.anyblok.org.Project StatusAnyBlok 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;InstallationInstall released versions of AnyBlok from the Python package index withpipor a similar tool:pip install anyblok_attachmentInstallation via source distribution is via thesetup.pyscript:python setup.py installInstallation will add theanyblokcommands to the environment.Unit TestRun the test withnose:pip install nose
nosetests anyblok_attachment/testsDependenciesAnyBlok / Attachment works withPython 3.5and later. The install process will
ensure thatAnyBlokis installed, in addition to other
dependencies. The latest version of them is strongly recommended.AuthorJean-Sébastien SuzanneContributorsAnyboxteam:Jean-Sébastien SuzanneSenseeteam:Franck BretHugo QuezadaBugsBugs and feature enhancements to AnyBlok should be reported on theIssue
tracker.ContentsAnyBlok attachmentFront MatterProject HomepageProject StatusInstallationUnit TestDependenciesAuthorContributorsBugsCHANGELOG2.2.0 (2021-8-17)2.1.0 (2020-05-05)2.0.0 (2018-11-28)1.2.0 (2018-09-14)1.1.1 (2018-06-05)1.1.0 (2018-05-16)1.0.2 (2018-02-24)1.0.1 (2018-01-11)1.0.0 (2018-01-10)CHANGELOG2.2.0 (2021-8-17)Adapted toAnyBlok >= 1.22.1.0 (2020-05-05)RemovedPython 3.4capabilityRemovedPython 3.5capabilityRefactored unittest, replaced nose by pytestAddedattachment_postgresblok, only for postgresql driver,
theLargeBinarycolumn is replaced byLargeObjectcolumn2.0.0 (2018-11-28)Removed the sequence created by the document. Replaced it by a simple counter on latest documentNoteYou 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();1.2.0 (2018-09-14)Allow to get another field to represent the filePR #4: Added a column name on the template to identify them easyly (@GohuHQ)PR #3: Fixed option name for wkhtmltopdf (@GohuHQ)1.1.1 (2018-06-05)Fix the mixins come fromanyblok_mixins1.1.0 (2018-05-16)[ADD] add MixinMixin.LatestDocumentandMixin.VersionedDocumentto help the developer to getlatest_documentorversioned_document1.0.2 (2018-02-24)[REF] Anyblok 0.17.0 changed setter to add application and application
groups, So I had to adapt the existing to use new setter1.0.1 (2018-01-11)[FIX]Mixin.WkHtml2Pdfcheck also if the configuration changed forTemplate.check_if_file_must_be_generated1.0.0 (2018-01-10)[ADD]attachmentblok: stock versionned file[ADD]reportblok: create versionned file from template[ADD]report-formatblok: template type[ADD]wkhtml2pdfblok: convert html to pdf in the template