j2labs / brubeck

Asynchronous web and messaging
http://brubeck.io
511 stars 66 forks source link

No objects called for_jsonschema and from_jsonschema in schematics.serialize #119

Open lovesh opened 11 years ago

lovesh commented 11 years ago

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

reduxdj commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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

lovesh commented 11 years ago

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

reduxdj commented 11 years ago

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 commented 11 years ago

https://github.com/reduxdj/schematics