Skip to main content

A simple implementation of a Django binary field that does automatic serialization/deserialization into/from MsgPack format.

Project description

django-msgpackfield
===================

Provides a binary django model field with automatic serialization/deserialization
of native Python structures into/from [MsgPack](http://msgpack.org) format.

It also comes with a form widget, basically a `<TEXTAREA>` where data can be
input in JSON. This data is then converted to MsgPack when the form is submitted.

Installation
------------

Install it with pip (or easy_install) :

pip3 install django-msgpackfield

Usage
-----

Typical usage in a Django model:
```python
from django.db import models
from msgpackfield import MsgPackField

class MyModel ( models.Model ) :
data = MsgPackField( null=True, blank=True )

obj = MyModel()
obj.data = { 'foo': 1, 'bar': 2, 'baz': [ 1, 2, 3, 4, 5 ] }
obj.save()
```

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-msgpackfield-0.14.tar.gz (4.0 kB view hashes)

Uploaded Source

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