此方案的正确缩进是什么:
class StorageType(models.Model):
""" Defining a general typ of storage """
name = models.CharField(
max_length=50,
help_text=_("The name for a storage type. Should be unique")
)
pep8抱怨
../models.py:68:13: E126 continuation line over-indented for hanging indent
../models.py:70:9: E121 continuation line under-indented for hanging indent
答案 0 :(得分:6)
我不知道"正确的一个",但这是我最喜欢的通过pep8
检查:
name = models.CharField(
max_length=50,
help_text=_("The name for a storage type. Should be unique")
)
答案 1 :(得分:5)
这是一个正确的缩进:
class StorageType(models.Model):
""" Defining a general typ of storage """
name = models.CharField(
max_length=50,
help_text=_("The name for a storage type. Should be unique")
)