我的代码是:
from django.db import models
from django.utils.encoding import smart_unicode
class SignUp(models.Model):
first_name = models.CharField(max_length=120, null=True, blank=True)
last_name = models.CharField(max_length=120, null=True, blank=True)
email = models.EmailField()
timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
updated = models.DateTimeField(auto_now_add=False, auto_now=True)
def __unicode__(self):
return smart_unicode(self.email)
这是我得到的。请帮忙谢谢你
^{pr2}$缩进错误:未缩进与任何外部缩进级别都不匹配
timestamp
前面有一个制表符。您应该使用空格或制表符来缩进Python,而不是两者都使用。您的编辑器可能会显示正确的缩进,但可能与Python理解制表符的方式不匹配。在PEP-8表示只使用空格。在
相关问题 更多 >
编程相关推荐