This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Django JSON Serializer

This is a django serializer that outputs sensible json to be sent to the frontend, rather than intended as a serializer to a file. Here’s an example:

>>> print s.serialize(User.objects.all(), relations=['groups'], excludes=['user_permissions'], indent=4)
[
    {
        "username": "dusty",
        "first_name": "",
        "last_name": "",
        "is_active": true,
        "is_superuser": true,
        "is_staff": true,
        "last_login": "2010-11-26 13:27:07",
        "groups": [
            {
                "pk": 1,
                "model": "auth.group",
                "name": "hello",
                "permissions": []
            }
        ],
        "pk": 1,
        "model": "auth.user",
        "password": "sha1$8f816$b4c8139100c314b46f1ca931858e4d6d5c61917f",
        "email": "dusty@linux.ca",
        "date_joined": "2010-11-22 17:55:40"
    }
]

The default serializer (djason.json) spits out a list of objects as a string. You can optionally have it return that list wrapped in an HttpResponse object by passing the httpresponse=True option into serialize.

There is a second serializer that takes two optional parameters, attributes (a dict) and list_name (a string). This serializer returns a dictionary with any key value attributes in the attributes dictionary, and one extra attribute named list_name, which contains the list of objects as returned by the json serializer. For example:

>>> print s.serialize(User.objects.all(), relations=['groups'], excludes=['user_permissions'], indent=4, attributes={'somekey': 'somevalue'}, list_name="users")
{
    "somekey": "somevalue",
    "users": [
        {
            "username": "dusty",
            "first_name": "",
            "last_name": "",
            "is_active": true,
            "is_superuser": true,
            "is_staff": true,
            "last_login": "2010-11-26 13:27:07",
            "groups": [
                {
                    "pk": 1,
                    "model": "auth.group",
                    "name": "hello",
                    "permissions": []
                }
            ],
            "pk": 1,
            "model": "auth.user",
            "password": "sha1$8f816$b4c8139100c314b46f1ca931858e4d6d5c61917f",
            "email": "dusty@linux.ca",
            "date_joined": "2010-11-22 17:55:40"
        }
    ]
}

This project was originally forked from: https://code.google.com/p/wadofstuff/wiki/DjangoFullSerializers

The original code produced a json format that was good for ./manage.py dump and load, but wasn’t as suitable for sending data to a web client for processing via ajax.

What’s new

Version 0.2 - Added a serializer that allows including the serialized object inside an object with extra attributes - Added an ‘httpresponse’ option that will automatically wrap the serialized stream in an HttpResponse object Version 0.1

Release History

Release History

0.2.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
djason-0.2.1.linux-i686.tar.gz (15.4 kB) Copy SHA256 Checksum SHA256 any Dumb Binary May 13, 2011
djason-0.2.1.tar.gz (6.9 kB) Copy SHA256 Checksum SHA256 Source May 13, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting