Fixed #21832

1st commit: Updates code, tests and docs.
2nd commit: Way to create fk instance at command line.
In order to shorten this, I felt that it would be better to use a variable `username_rel` = `self.username_field.rel` rather than using it thrice.