Django breaking long lookup names on queries

pep8 says:

The preferred way of wrapping long lines is by using Python's implied line continuation inside parentheses, brackets and braces.

That's what you've done, so I think what you've got is the most pythonic (or, at least, most pep8ic) way of doing it.


Maybe using LOOKUP_SEP to join the lookup names is a bit more paletable?

from django.db.models.constants import LOOKUP_SEP

lookup = LOOKUP_SEP.join(['myfk', 'child', 'onetoone', 'another', 'manytomany',
                          'relation', 'monster', 'relationship',
                          'mycustomlookup'])

QuerySet.filter(**{lookup:':P'})