Some imports fail due to too long variables

Issue #64 resolved
Jonathan Cole created an issue

When attempting to import dicom dose data eg from Siemens Inspiration the import fails.

The error message makes it clear that the imported data is too long for the CharField(max_length=64) fields.

Changing CharField(max_length=64) fields to TextField solves the issue but might introduce other problems.

Comments (13)

  1. Jonathan Cole reporter

    I guess it depends then on whether we have any other good cause to limit the fields or if the performance on MySQL suffers adversely. The clearly short ones (like 16 chars) should be fine as they are.

  2. Ed McDonagh

    I think I made comment fields as TextFields, but mistakenly added a max length to them that is unnecessary.

  3. Jonathan Cole reporter

    The ones I had trouble with were software version and I think one other CharField(max_length=64,...) as I did a find and replace with TextField.

  4. Ed McDonagh

    All CharFields with a max_length attribute of 64 or 128 have been changed to TextFields. The orginial length was set according to the DICOM field type definition, but manufacturers ignoring that is not a reason to fail to import. Will require database migration. Opens #64, Refs #64.

    → <<cset 27f99a70662d>>

  5. Ed McDonagh

    Added null=True to all fields that only had blank=True. Most fields had already been changed when problems were hit during early testing - this should prevent unnecessary problems in the future. Sort of refs #64.

    → <<cset d370b57af433>>

  6. Ed McDonagh

    Longer char fields converted to text fields, max_length on text fields removed, non-nullable fields made nullable. Some associated documentation. Requires database schema migration. Closes #64.

    → <<cset ddf6cdf6d0dc>>

  7. Log in to comment