create_doc should take a dict and we need create_doc_from_json

Bug #1026751 reported by Lucio Torre
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
U1DB
Fix Released
High
Eric Casteleijn

Bug Description

The first thing one does when using u1db is:

 >>> content = json.dumps({"name": "John Barnes", "position": "forward"}) # create a document
 >>> doc2 = db.create_doc(content)

which doesnt make much sense as we will be trating the document as a dict in doc.content and the user wont have to care about json ever again.

This should look like this:

 >>> doc2 = db.create_doc({"name": "John Barnes", "position": "forward"}) # create a document

And if you want to use json:

 >>> doc2 = db.create_doc_from_json(json_data) # create a document

Related branches

Changed in u1db:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Eric Casteleijn (thisfred)
Changed in u1db:
status: Triaged → In Progress
Changed in u1db:
status: In Progress → Fix Committed
Changed in u1db:
milestone: none → 0.0.3
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.