Skip to content

digia/jsoongia

develop
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

JSOONGIA - JSON API

=================== A framework agnostic JSON API serializer.

Currently a work in progress TODO: [X] Meta [X] Include/Relationships [ ] Links [ ] Refactor tests/Add tests [ ] Setup for PIP [ ] Create a 'real' README

Quick Example

# serializers.py
from jsoongia import Serializer, relationships

class UserSerializer(Serializer):
    ref = 'id'
    type = 'user'
    attributes = ['email', 'fname', 'lname']
    relationships = {
        'comment': {
            'serializer': CommentSerializer,
            'relationship': relationships.BelongsTo('user_id')
        }
    }


# views.py
from .serializers import UserSerializer

def get_something():
    serializer = UserSerializer
    data = {...}
    included = {'comment': ...}

    serialized = serializer.serialize(data, included)

About

Python framework agnostic JSON API serializer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages