This is a common case in django ORM.
from django.db import models
class Author(models.Model):
__author__ = 'mbrzustowicz' | |
# metadata.json has single quotes like this | |
# {'asin': 'B00M0AEPXG', 'imUrl': 'http://ecx.images-amazon.com/images/I/51hcXTUeHLL._BO2,204,203,200_ ..... } | |
# so the strategy is to read each line as a string, and dump into a REAL json file | |
import json | |
import ast | |
fr=open("/Users/mbrzustowicz/Downloads/metadata.json") |
"""Allows checking of form POST data as well as uploaded files when validating | |
a standard Django `forms.Form`. | |
The short version is that you check `Form().files` in the `clean()` method, | |
assuming the form has been bound to the request. | |
See: | |
http://mattoc.com/django-handle-form-validation-with-combined-post-and-files-data/ | |
""" |