You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,7 @@ key_fields = ('name', )
49
49
ret = bulk_sync(
50
50
new_models=new_models,
51
51
filters=filters,
52
+
fields=['name', 'phone_number', ...],
52
53
key_fields=key_fields)
53
54
54
55
print("Results of bulk_sync: "
@@ -66,6 +67,7 @@ Combine bulk create, update, and delete. Make the DB match a set of in-memory o
66
67
-`key_fields`: Identifying attribute name(s) to match up `new_models` items with database rows. If a foreign key is being used as a key field, be sure to pass the `fieldname_id` rather than the `fieldname`.
67
68
-`filters`: Q() filters specifying the subset of the database to work in.
68
69
-`batch_size`: passes through to Django `bulk_create.batch_size` and `bulk_update.batch_size`, and controls how many objects are created/updated per SQL query.
70
+
-`fields`: a list of fields to update - passed through to Django's built in `buld_update`
0 commit comments