A Django app providing a ChunkedTextField for storing large text data in chunks.
Project description
Django Chunked Field
This project provides a custom Django field, ChunkedTextField, designed to handle large text data by splitting it into
manageable chunks for storage in a separate database table. Unlike traditional text fields, which may face size
limitations in certain database systems, ChunkedTextField bypasses these constraints while seamlessly integrating with
Django's ORM. It works transparently with serializers, admin interfaces, and other ORM features, allowing developers to
store and retrieve large text data without changing their application logic. The field is particularly useful in
applications requiring efficient management of text data exceeding database limits, ensuring scalability and ease of
use.
Features
- Store large text data exceeding database field size limits.
- Seamlessly integrates with Django's admin and ORM.
- Customizable truncation for admin display.
Installation
-
Install the package using pip:
pip install django-chunked-field
-
Add
chunked_fieldto yourINSTALLED_APPSin your Django settings:INSTALLED_APPS = [ ... 'chunked_field', ]
-
Run the migrations to create the necessary database tables:
python manage.py migrate
Usage
Defining a Model
To use the ChunkedTextField, define it in your model as follows:
from django.db import models
from chunked_field.fields import ChunkedTextField
class MyModel(models.Model):
large_text = ChunkedTextField(truncate_length=100, chunk_size=4000)
Admin Integration
To display the DataChunk model in the Django admin, register it in admin.py:
from django.contrib import admin
from chunked_field.models import DataChunk
@admin.register(DataChunk)
class DataChunkAdmin(admin.ModelAdmin):
list_display = ('content_type', 'object_id', 'field_name', 'sequence')
list_filter = ('content_type', 'field_name')
search_fields = ('content',)
Signal Handlers
The ChunkedTextField automatically handles the chunking and reassembly of data using Django signals. You do not need
to manually manage these operations.
License
This project is licensed under the MIT License.
This update includes installation instructions, usage examples, and admin integration details.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_chunked_field-0.0.2.tar.gz.
File metadata
- Download URL: django_chunked_field-0.0.2.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96c9a4bc9d91fc8e5d31cdb952f3b3945a5b5c0201a09193c99c8309dee0b106
|
|
| MD5 |
652763a9033e85e08e6811faf1a22d0d
|
|
| BLAKE2b-256 |
13d451d15ab563a37f1354b4a7fb43c7caf2d0cc5b74899218800877a36182c6
|
File details
Details for the file django_chunked_field-0.0.2-py3-none-any.whl.
File metadata
- Download URL: django_chunked_field-0.0.2-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7afc57cd7fca92c4c09c0dbadced01d8999f64fe80f895028fcb3fe060496b72
|
|
| MD5 |
ed07dec49334b96a8ce647dfa1b46de7
|
|
| BLAKE2b-256 |
9adf2cf50ed833a4e2833b5876d1423991ef1c5b5a9f9eeaa3dc4dbe0c856ffa
|