To prevent max recursion depth errors when creating a model which references itself, I have slightly modified the behavior of generate_fk. When it detects that it is a self referencing foreign key field which allows None, instead of creating a new instance it just sets None. If the field does not allow None it throws a CreateInstanceError.
I think this is a sane default, your thoughts would be appreciated though.
To prevent max recursion depth errors when creating a model which references itself, I have slightly modified the behavior of generate_fk. When it detects that it is a self referencing foreign key field which allows None, instead of creating a new instance it just sets None. If the field does not allow None it throws a CreateInstanceError.
I think this is a sane default, your thoughts would be appreciated though.
Thanks!