Airtable integration for Django-based projects
This project's target is to make the Airtable import easier in Django-based applications.
Add aa_airtable to your app's INSTALLED_APPS, and also set AIRTABLE_SETTINGS in project settings.
After all please migrate the app (./manage.py migrate aa_airtable).
- API_KEY - Airtable API key.
- DATABASES - Database settings eg.
("Media", "tests.parsers.MediaParser")whereMediais table name andtests.parsers.MediaParseris path to table parser- ENDPOINT_URL - Airtable API endpoint url.
- DATA_DIRECTORY - Folder with json data backups.
- FILES_DIRECTORY - Folder with uploaded files to airtable.
- SAVE_FILES - Should library save uploaded files (default: True)
from aa_airtable.parser import AbstractParser
class ArticleParser(AbstractParser):
model = Article
raw_fields = [
"Name",
("custom_name", "Title"),
"Description",
]
related_fields = [
("gallery", "Gallery", Media),
]
file_fields = [
"NY Logo"
]
- Django 1.11
- Python 3.4-3.6