Skip to content

Commit 66f174c

Browse files
committed
Added documentation/changelog for #16, and blacked repo.
1 parent 2b0c474 commit 66f174c

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### Added
6+
7+
- Added exclude_fields argument. Issue #15, pull request #16 from [@VKFisher](https://github.com/VKFisher).
8+
59
## [3.0.1] - 2020-08-05
610

711
### Updated

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Combine bulk create, update, and delete. Make the DB match a set of in-memory ob
7474
- `filters`: Q() filters specifying the subset of the database to work in. Use `None` or `[]` if you want to sync against the entire table.
7575
- `batch_size`: (optional) passes through to Django `bulk_create.batch_size` and `bulk_update.batch_size`, and controls how many objects are created/updated per SQL query.
7676
- `fields`: (optional) List of fields to update. If not set, will sync all fields that are editable and not auto-created.
77+
- `exclude_fields`: (optional) list of fields to exclude from updates. Subtracts from the passed-in `fields` or default-calculated `fields` (see `fields` documentation above).
7778
- `exclude_fields`: (optional) List of fields to exclude from updates.
7879
- `skip_creates`: (optional) If truthy, will not perform any object creations needed to fully sync. Defaults to not skip.
7980
- `skip_updates`: (optional) If truthy, will not perform any object updates needed to fully sync. Defaults to not skip.

bulk_sync/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ def bulk_sync(
2929
how many objects are created/updated per SQL query.
3030
`fields`: (optional) list of fields to update. If not set, will sync all fields that are editable and not
3131
auto-created.
32-
`exclude_fields`: (optional) list of fields to exclude from updates.
32+
`exclude_fields`: (optional) list of fields to exclude from updates. Subtracts from the passed-in `fields` or
33+
default-calculated `fields` (see `fields` documentation above.)
3334
`skip_creates`: If truthy, will not perform any object creations needed to fully sync. Defaults to not skip.
3435
`skip_updates`: If truthy, will not perform any object updates needed to fully sync. Defaults to not skip.
3536
`skip_deletes`: If truthy, will not perform any object deletions needed to fully sync. Defaults to not skip.

runtest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import django
55

66
if __name__ == "__main__":
7-
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings'
7+
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.test_settings"
88

99
from django.conf import settings
1010
from django.test.utils import get_runner
@@ -15,4 +15,3 @@
1515
test_runner = TestRunner()
1616
failures = test_runner.run_tests(["tests"])
1717
sys.exit(bool(failures))
18-

tests/test_settings.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33

44
BASE_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), os.pardir)
55

6-
SECRET_KEY = 'testsecretkey43u2894u329h432nuhrn32iu'
6+
SECRET_KEY = "testsecretkey43u2894u329h432nuhrn32iu"
77
DEBUG = True
88

99
db_url = os.environ.get("DATABASE_URL", "sqlite://localhost/:memory:")
1010
DB = dj_database_url.parse(db_url)
1111

12-
DATABASES = {
13-
'default': DB,
14-
}
12+
DATABASES = {"default": DB}
1513

16-
INSTALLED_APPS = ('bulk_sync', 'tests',)
14+
INSTALLED_APPS = ("bulk_sync", "tests")
1715
MIDDLEWARE_CLASSES = ()

0 commit comments

Comments
 (0)