openmicroscopy/openmicroscopy — pull request #892 by mtbc (2013-03-15 16:13:02+00:00)
Title: Avoid setting dummy values inappropriately for original files.

The previous code had dummy required values being set for hashes and lengths of `OriginalFile` instances for things like files that hadn't yet been uploaded, and for directories. Discussion in http://trac.openmicroscopy.org.uk/ome/ticket/2581 considers the idea of simply allowing such properties to be set to `null` unless there is actually an applicable value for them, so as to declutter the code and the database.

This PR makes the size and checksum optional, to tidy things slightly in anticipation of further changes once the checksum algorithm is made selectable.

In testing, one might want to check the `originalfile` table to make sure that some `size` or `sha1` that was previously being correctly set still is set, i.e. that this PR causes no regressions.

In the longer term one may want to consider designing a richer type hierarchy around `OriginalFile`.