-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor AirtableMixin.create_record and update_record into a single …
…method (#75) * Reshuffle AirtableMixin.save to avoid redundant saves Also, don't bother keeping track of the return value of `super().save()`, because there isn't one. * Combine `create_record` and `update_record` methods into `save_to_airtable` Fixes #2 The semantics of the two methods cross over (and call each other - a creation might actually be an update and vice versa) to the point that it isn't worth them being distinct methods. Regardless of whether this is a new Django record or not, the process will always be: * if we have an `airtable_record_id` and it exists in Airtable, update that record * otherwise, if we can find an Airtable record based on unique identifier, update that record and adopt its record ID * otherwise, create a new Airtable record and adopt its record ID * Update tests to cover all cases of save_to_airtable * Add test for match_record with AIRTABLE_UNIQUE_IDENTIFIER defined as a dict
- Loading branch information
Showing
6 changed files
with
237 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.