Some imports fail due to too long variables
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)
-
-
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.
-
The comment fields are set as TextField, but I mistakenly added a MaxLength.
-
I think I made comment fields as TextFields, but mistakenly added a max length to them that is unnecessary.
-
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.
-
- changed milestone to 0.4.0
-
Removed max_length from TextField attributes as it shouldn't have been there. Refs
#64, but not the main event.→ <<cset 2a71a64a9a9c>>
-
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>>
-
- changed status to open
-
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>>
-
Adding note to the release docs referring to the schemamigration required for this release. Refs
#64.→ <<cset 3d20ddf52686>>
-
Added formatting to the section quoting the South migration message, and some context before and after. Refs
#64.→ <<cset a1d93c0cae20>>
-
- changed status to resolved
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>>
- Log in to comment
The wisdom of SO seems to agree with you: http://stackoverflow.com/questions/7354588/django-charfield-vs-textfield