Skip to main content

Attachments management app for django

Project description

version downloads license

Django application to manage attached files to any django model.

Install

pip install django_attachments_management

Configure

Add ‘django_attachments’ to INSTALLED_APPS.

Usage

Add GalleryField or LibraryField to django model.

from django.db import models
from django_attachments.fields import LibraryField, GalleryField


class Article(models.Model):
        title = models.CharField(max_length=100)
        attachments = LibraryField(related_name='articles_with_attachment', on_delete=models.CASCADE)
        gallery = GalleryField(related_name='articles_with_gallery', on_delete=models.CASCADE)

Use AttachmentsAdminMixin to enable attachments in admin interface.

from django.contrib import admin

from .models import Article
from django_attachments.admin import AttachmentsAdminMixin


class ArticleAdmin(AttachmentsAdminMixin, admin.ModelAdmin):
        pass


admin.site.register(Article, ArticleAdmin)

Screenshots

https://raw.github.com/wiki/mireq/django-attachments/django_attachments.png?v2022-12-11

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_attachments_management-1.2.2.tar.gz (58.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django_attachments_management-1.2.2.tar.gz.

File metadata

File hashes

Hashes for django_attachments_management-1.2.2.tar.gz
Algorithm Hash digest
SHA256 03e7aa3136e5e32c842871216c58e548cb862724e44b842264d3866b1c44335a
MD5 ee8a239bd8c64bd040d2b53b268bdb21
BLAKE2b-256 1054f7cc9c84203d64c039ed460bc01e1cccec12a32a9971dc5727e431b87ddf

See more details on using hashes here.

File details

Details for the file django_attachments_management-1.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_attachments_management-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ccb06396aa344dd3ba11bcc5b1146b6179d3960da1facae7651177b825770916
MD5 226a9be643a2efbbe3ae3f2d2b513674
BLAKE2b-256 1e209064e2e97941be11dfb08c8d8b57fb12b38db99435e8267477393aa6de59

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page