[Answer]-Parsing in couchdbkit

1👍

Use the json module, ex:

import json
obj = json.loads("{'value': 'UMMC', 'id': 'ef688c440131f59262f2c4f80d001c87', 'key': 'ef688c440131f59262f2c4f80d001c87'}")
# now obj["value"] == "UMMC";
👤hexist

0👍

Thanks every one for the help.

In my views.py I had the following:

projects = db.view('projects/name')

and I was trying to display the content of the ‘value’ attribute in my django template base_site.html

{'value': 'UMMC', 'id': 'ef688c440131f59262f2c4f80d001c87', 'key': 'ef688c440131f59262f2c4f80d001c87'}

so I did:

{%for p in projects%}
   <td>{{p.value }} </td>
{% endfor %}

And it displayed exactly the content of ‘value’ attribute,
Again thanks so much, your feedback really guided me.

Leave a comment