Attachments management app for django
Project description
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
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
Built Distribution
File details
Details for the file django_attachments_management-1.2.2.tar.gz
.
File metadata
- Download URL: django_attachments_management-1.2.2.tar.gz
- Upload date:
- Size: 58.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03e7aa3136e5e32c842871216c58e548cb862724e44b842264d3866b1c44335a |
|
MD5 | ee8a239bd8c64bd040d2b53b268bdb21 |
|
BLAKE2b-256 | 1054f7cc9c84203d64c039ed460bc01e1cccec12a32a9971dc5727e431b87ddf |
File details
Details for the file django_attachments_management-1.2.2-py3-none-any.whl
.
File metadata
- Download URL: django_attachments_management-1.2.2-py3-none-any.whl
- Upload date:
- Size: 60.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccb06396aa344dd3ba11bcc5b1146b6179d3960da1facae7651177b825770916 |
|
MD5 | 226a9be643a2efbbe3ae3f2d2b513674 |
|
BLAKE2b-256 | 1e209064e2e97941be11dfb08c8d8b57fb12b38db99435e8267477393aa6de59 |