@@ -263,7 +263,7 @@ def to_json(self):
263
263
return json .dumps (self .serializable_data (), cls = DjangoJSONEncoder )
264
264
265
265
@classmethod
266
- def from_serializable_data (cls , data , check_fks = True , strict_fks = False ):
266
+ def from_serializable_data (cls , data , check_fks = True , strict_fks = False , exclude_fields = None ):
267
267
"""
268
268
Build an instance of this model from the JSON-like structure passed in,
269
269
recursing into related objects as required.
@@ -275,7 +275,7 @@ def from_serializable_data(cls, data, check_fks=True, strict_fks=False):
275
275
in which case any dangling foreign keys with on_delete=CASCADE will cause None to be
276
276
returned for the entire object.
277
277
"""
278
- obj = model_from_serializable_data (cls , data , check_fks = check_fks , strict_fks = strict_fks )
278
+ obj = model_from_serializable_data (cls , data , check_fks = check_fks , strict_fks = strict_fks , exclude_fields = exclude_fields )
279
279
if obj is None :
280
280
return None
281
281
@@ -307,8 +307,8 @@ def from_serializable_data(cls, data, check_fks=True, strict_fks=False):
307
307
return obj
308
308
309
309
@classmethod
310
- def from_json (cls , json_data , check_fks = True , strict_fks = False ):
311
- return cls .from_serializable_data (json .loads (json_data ), check_fks = check_fks , strict_fks = strict_fks )
310
+ def from_json (cls , json_data , check_fks = True , strict_fks = False , exclude_fields = None ):
311
+ return cls .from_serializable_data (json .loads (json_data ), check_fks = check_fks , strict_fks = strict_fks , exclude_fields = exclude_fields )
312
312
313
313
@transaction .atomic
314
314
def copy_child_relation (self , child_relation , target , commit = False , append = False ):
0 commit comments