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.
Metadata
Release files for django-chunked-field 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_chunked_field-0.0.6.tar.gz | 10.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_chunked_field-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.5 kB
Release files / django_chunked_field-0.0.6.tar.gz
| Download URL | django_chunked_field-0.0.6.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
524550562b8b9ea94e95778a8b74b4a463121a450a0463a1cc62516df028cc83
|
|
BLAKE2b-256 checksum How to use checksums |
4b3ef2b1457c415406274567329006df677c11f3f3cfd86c2a9f73b89fa5af96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.8.10
|
Release files / django_chunked_field-0.0.6-py3-none-any.whl
| Download URL | django_chunked_field-0.0.6-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0302f473b3aaf63b7a1b7b0b328b6abb095dec30ecee9ae706f934a27ba22a7a
|
|
BLAKE2b-256 checksum How to use checksums |
d5d984cae75bbe2002508ab8624206eeb61d9b10d6ff6d6cc4fd4aab01d8638b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.8.10
|