pyairtable
pyairtable copied to clipboard
Flagging computed fields in ORM
Add flag for computed fields in orm.fields.Field and use this attribute to resolve error on record updates in orm.model.Model.save()
Thanks for the quick turn around.
This looks good to me. Just need a few more things to make it ready to ship:
- Can you add a unit test in the orm test suite?
- maybe a note in the orm docs?
Wouldnt it make sense to rename this parameter to something else? I was thinking about this, as I need to download images via airtable: https://github.com/gtalarico/pyairtable/issues/179
Now if we want to add this image implementation, I think it could be tricky to get it right to support download and upload. I think for the first run a download-only option would make sense, and then this PR comes into play:
In this case the image fields are not computed, but we rather want to treat it read-only. So maybe a more generic name would be read_only in this case?
Your suggestion makes sense to me, @NicoHood. I've updated the parameter name to read_only.
@gtalarico I'm not very familiar with pytest 😬 but I added a test and updated the test suite for this feature and they pass. Might be worth another set of eyes on the code, though.
Sorry for the delay here @larsakerson will review this and incorporate it
My apologies. I've incorporated the suggestions; let me know if anything else is needed here, @gtalarico