Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EDTFField fails to re-save fields without natural text field value #15

Open
jmurty opened this issue May 29, 2017 · 1 comment
Open

Comments

@jmurty
Copy link
Contributor

jmurty commented May 29, 2017

If the EDTFField value is set on a model instance and the instance is subsequently re-saved with an empty natural_text_field value, the pre_save method fails because it tries to re-parse the existing EDTF field python value which is not a string.

@jmurty
Copy link
Contributor Author

jmurty commented May 29, 2017

This is currently an issue for AGSA in particular because we are deliberately setting just the EDTF field on works without setting the corresponding natural_text_field value at all, which is backwards from the way the field wants to be used.

jmurty added a commit that referenced this issue May 29, 2017
Improve performance of EDTFField when populating model
instances from DB values by storing EDTF data in pickled
format, not as string values that need to be re-parsed
every time they are loaded.

This implementation is naive and could be improved with
a more sophisticated serialization approach for EDTF
fields, though it works for now.

This change also handles the issue in #15 where already-
parsed EDTF field values are re-parsed when an instance
is saved, unless there is a `natural_text_field` value
present to override and reset the EDTF field value.
jmurty added a commit that referenced this issue Jun 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant