as_json tag uses Django's json encoder, which no longer comaptible with simplejson

Create issue
Issue #1473 new
marconius created an issue

with Django 1.5 the detail_configurableproduct.html template is doesn't load because Django's subclass of simplejason.JSONEncode is not compatible with simplejson > 2.1. To fix can we simply use the JSONEncode class directly from simplejson?

Comments (4)

  1. marconius reporter

    I included the link to a commit in the bug description, but it doesn't really fix the problem, because it doesn't take into consideration all these possible situations:

    1. django.utils.simplejson is availble (with Django<=1.6), or simplejson <= 2.1 is installed: the current code works in this situation.
    2. django.utils.simplejson is not availble (with Django 1.7 and up), and simplejson > 2.1 is installed: In this case code doesn't work because of what I said up top.
    3. django.utils.simplejson is not availble, and simplejson is not installed: the module needs to be refactored to either be compatible with the Python standard lib's json or with simplejson which would become a dependency.

    I think I'll work on something to implement a solution for the third situation as it is the most durable solution. It will use json with fallback on simplejson in case someone is using Ptyhon 2.5

  2. Chris Moffitt repo owner

    We can certainly change the name of satchmo_utils.json to something else if we need to.

  3. Log in to comment