Changed from using a string to importing the actual CASCADE function

This commit is contained in:
Brent O'Connor 2018-02-27 11:18:07 -06:00
parent a8dc71bcb1
commit f6cd053f74

View file

@ -62,7 +62,7 @@ class Registry(object):
for fld in field_definitions:
extra_params = {'to': 'categories.Category', 'blank': True}
if field_type != 'ManyToManyField':
extra_params['on_delete'] = 'CASCADE'
extra_params['on_delete'] = CASCADE
extra_params['null'] = True
if isinstance(fld, str):
field_name = fld