PEP8 info:
models.py:10:80: E501 line too long (83 > 79 characters)
Models.py:
field = TreeForeignKey(\'self\', null
I usually split that to line up the parameters one level of indentation deeper than the original line, like:
field = TreeForeignKey('self', null=True,
blank=True, related_name='abcdefgh')
Especially if TreeForeignKey
is something like TreeForeignKeyWithReferencesToSomethingElse
, in which case all the parameters would start out to the far right of the window if you lined them all up with the opening parenthesis. If any of the parameters had a long name like defaultvalueforcertaincircumstances
, you might not be able to fit the whole thing in under 80 columns:
field = TreeForeignKeyWithReferencesToSomethingElse('self',
defaultvalueforcertaincircumstances='foo')
I also prefer to put multiple function parameters on the same line (except when it just doesn't look right; I'm not a purist!) so that vertical space isn't overly expanded, causing me to spend more time scrolling around in my editor than otherwise necessary.