News for hackers. Stuff that matters.
Re:Django Rest Framework general model serializer by andybak on Saturday January 31, 2015 @08:55PM (#8978874)
Just tried it:

    from django.core import serializers
    print serializers.serialize("json", StockCount.objects.all()[:2])
    >> [{"fields": {"timestamp": "1900-01-02T00:00:00Z", "version": 0, "item_instance": null, "item_model": 408, "stock_level": 999, "location": 2}, "model": "stocklevels.stockcount", "pk": 1}, {"fields": {"timestamp": "1900-01-02T00:00:00Z", "version": 0, "item_instance": null, "item_model": 409, "stock_level": 999, "location": 2}, "model": "stocklevels.stockcount", "pk": 2}]

There are no comments on this comment yet.