template tag to get form field value
** Allows to get field value in the template. ** First load template tag. Then {% field_value form.field %}
- forms
- field
- value
** Allows to get field value in the template. ** First load template tag. Then {% field_value form.field %}
Shows difference between two json like python objects. May help to test json response, piston API powered sites... Shows properties, values from first object that are not in the second. Example: import simplejson # or other json serializer first = simplejson.loads('{"first_name": "Poligraph", "last_name": "Sharikov",}') second = simplejson.loads('{"first_name": "Poligraphovich", "pet_name": "Sharik"}') df = Diff(first, second) df.difference is ["path: last_name"] Diff(first, second, vice_versa=True) gives you difference from both objects in the one result. df.difference is ["path: last_name", "path: pet_name"] Diff(first, second, with_values=True) gives you difference of the values strings.
nmb10 has posted 2 snippets.