Metadata-Version: 2.4
Name: django-attachment-helpers
Version: 0.1.2
Summary: Generic create and delete helpers for Django attachment models
Author-email: Hemant Rawal <rawalhemant2059@gmail.com>
License-Expression: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: django>=3.2

# django-attachment-helpers

Generic create and delete helpers for any Django attachment model.

## Install
pip install django-attachment-helpers

## Usage

from django_attachment_helpers import create_attachments,delete_attachments


# Create attachments
create_attachments(
    model=ReportDoc,
    parent_field="report",
    parent_instance=report_obj,
    titles=["Invoice", "Receipt"],
    docs=[file1, file2],
)

# Delete attachments
delete_attachments(
    model=ReportDoc,
    parent_field="report",
    parent_instance=report_obj,
    deleted_ids=["1", "2"],
)
