brubeck icon indicating copy to clipboard operation
brubeck copied to clipboard

No objects called for_jsonschema and from_jsonschema in schematics.serialize

Open lovesh opened this issue 12 years ago • 6 comments

In request_handling.py on line 58 from schematics.serialize import for_jsonschema, from_jsonschema but the schematics.serialize module at https://github.com/j2labs/schematics/blob/master/schematics/serialize.py do not contain any object named for_jsonschema or from_jsonschema. Also from_jsonschema is unused in the request_handling module

lovesh avatar Sep 09 '13 09:09 lovesh

Noticed the same thing:

Traceback (most recent call last): File "./listsurf.py", line 6, in from brubeck.connections import Mongrel2Connection File "/Users/dj/.virtualenvs/listsurf/lib/python2.7/site-packages/brubeck-0.4.0-py2.7.egg/brubeck/connections.py", line 9, in from request_handling import http_response, coro_spawn File "/Users/dj/.virtualenvs/listsurf/lib/python2.7/site-packages/brubeck-0.4.0-py2.7.egg/brubeck/request_handling.py", line 58, in from schematics.serialize import for_jsonschema, from_jsonschema ImportError: cannot import name for_jsonschema

reduxdj avatar Sep 16 '13 01:09 reduxdj

Looks like this same functionality is done here:

https://github.com/j2labs/dictshield/blob/master/dictshield/document.py

def _to_fields

and in def to_json

I would imagine they would work a similar way. I hope this issue gets fixed soon.

reduxdj avatar Sep 16 '13 13:09 reduxdj

Actually, I don't even think this import is needed any more

reduxdj avatar Sep 17 '13 12:09 reduxdj

I found the above two functions at https://github.com/st4lk/schematics/blob/master/schematics/serialize.py

lovesh avatar Sep 17 '13 19:09 lovesh

I created a pull request to add this back in for schematics, I also have a version of schematics working with this in my branch, if you install this version of schematics it shouldn't complain:

reduxdj avatar Sep 18 '13 14:09 reduxdj

https://github.com/reduxdj/schematics

reduxdj avatar Sep 18 '13 14:09 reduxdj