can't write datetime objects directly to JSON
file.role comes from entity['files'] not entity['filemeta']
get file/filemeta fields from constant instead of hard-coding

Rather than cutting and pasting the fields from FILE and FILEMETA
(and hoping you remember them all), get the keys from constants
and load/dump programmatically.
DDRFile method for making a sorl thumbnail
adjustments to Entity.add_file(); added make_thumbnail
check for existence of thumbnail before trying to display

Some files are truly huge and some simply can't even be used
to generate thumbs.  By default, sorl attempts to make a thumbnail
every time until it succeeds.
The Entity.add_file() method marks whether it was possible to
generate a thumbnail during ingest and indicates whether or not
to even attempt to display a thumbnail.