Skip to content

digia/jsoongia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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