Hi People!

I have added the following field to order:

    (
        "cartridge.shop.models.Order.billing_detail_municipality",
        "ForeignKey",
        ("cartridge_chilean_shipping.Municipality",),
        {"verbose_name": _("Municipality"), "related_name":
"orders_billing",
         },
    ),

It is displayed correctly in the checkout form, but when I go to the next
step I got:

Traceback:
File
"/home/rodrigo/.virtualenvs/dartel/lib/python2.7/site-packages/django/core/handlers/base.py"
in get_response
  223.                 response = middleware_method(request, response)
File
"/home/rodrigo/.virtualenvs/dartel/lib/python2.7/site-packages/django/contrib/sessions/middleware.py"
in process_response
  50.                         request.session.save()
File
"/home/rodrigo/.virtualenvs/dartel/lib/python2.7/site-packages/redis_sessions/session.py"
in save
  80.         data = self.encode(self._get_session(no_load=must_create))
File
"/home/rodrigo/.virtualenvs/dartel/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py"
in encode
  88.         serialized = self.serializer().dumps(session_dict)
File
"/home/rodrigo/.virtualenvs/dartel/lib/python2.7/site-packages/django/core/signing.py"
in dumps
  90.         return json.dumps(obj, separators=(',',
':')).encode('latin-1')
File "/usr/lib64/python2.7/json/__init__.py" in dumps
  251.         sort_keys=sort_keys, **kw).encode(obj)
File "/usr/lib64/python2.7/json/encoder.py" in encode
  207.         chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib64/python2.7/json/encoder.py" in iterencode
  270.         return _iterencode(o, 0)
File "/usr/lib64/python2.7/json/encoder.py" in default
  184.         raise TypeError(repr(o) + " is not JSON serializable")

Exception Type: TypeError at /shop/checkout/
Exception Value: <Municipality: 2101 - Antofagasta (Antofagasta,
Antofagasta)> is not JSON serializable

The problem seems to be because I'm using redis-sessions (because I need
django-ws4redis) and models with FK can't be serialized out of the box.
Without the FK it works like a charm. I have tried to set a custom
serializer for JSON but with no success.

Has someone dealt with this before?

Thanks in advance,
Rodrigo

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to