Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > Django Plugins

    django-preserialize 1.0.4

    Download button

    No screenshots available
    Downloads: 62  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Byron Ruth | More programs
    BSD License / FREE
    September 11th, 2012, 21:26 GMT
    ROOT / Internet / Django Plugins

     Read user reviews (0)  Refer to a friend  Subscribe

    django-preserialize description

    Pre-serialize model instances and querysets

    django-preserialize is a Django app that makes sure an object is free of QuerySet and Model instances.

    Install

    pip install django-preserialize

    Docs

    A serialized user object might look like this:

    >>> from preserialize.serialize import serialize
    >>> serialize(user)
    {
     'date_joined': datetime.datetime(2009, 5, 16, 15, 52, 40),
     'email': u'jon@doe.com',
     'first_name': u'Jon',
     'groups': [5],
     'id': 1,
     'is_active': True,
     'is_staff': True,
     'is_superuser': True,
     'last_login': datetime.datetime(2012, 3, 3, 17, 40, 41, 927637),
     'last_name': u'Doe',
     'password': u'!',
     'user_permissions': [1, 2, 3],
     'username': u'jdoe'
    }

    This can then be passed off to a serializer/encoder, e.g. JSON, to turn it into a string for the response body (or whatever else you want to do).


    Product's homepage

    Requirements:

    · Python
    · Django

      


    TAGS:

    model instances | preserialize querysets | Django preserialize | Django | preserialize | model

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM