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.5.tar.gz (58.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_attachments_management-1.2.5-py3-none-any.whl (60.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_attachments_management-1.2.5.tar.gz
Algorithm Hash digest
SHA256 7444b78cab50fa0f42946c93f29d361d6bf396684411e7934bc25c0d5654afb3
MD5 7eaad855bd25132f08aacf191048eaac
BLAKE2b-256 4a05b999382cc5d22384adec6d88d961b42690dc48cb4de2e35c7db17f1cfd63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_attachments_management-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 71ba71634361dc4e03f900816a5b0d05e0a1cd86da9a5357189837e6cf793fa2
MD5 f20c4648aace370ead40268304b7907d
BLAKE2b-256 06b34a95f698d558848acf5497d4264ca81200d41cf59c05cd67da9bfdc06a9b

See more details on using hashes here.

Supported by

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