Long Django query statements

I have a preference to wrap long Django queries like this:

for p58 in (Piece2x2

How to configure PyCharm to get this indentation behavior?

When I break a line at the dot it gets indented a static amount (8 in my case) while function call parameters are nicely aligned with the initial parenthesis (see below).

def long_function_with_many_args(self,
                                 long_argument_1: int,
                                 long_argument_2: list,
                                 optional_extra_arguments="this is an example"):

Suggestions which settings that could help?

More pythonic layout suggestions are also welcome  :-)


1 comment
Unfortunately, there is no way to configure this code style in the current PyCharm release.
But if Black supports this, you can set black formatter by following this guide: https://www.jetbrains.com/help/pycharm/reformat-and-rearrange-code.html#format-python-code-with-black

Please sign in to leave a comment.