class Test(models.Model):
name = models.CharField('名称', max_length=64, unique=True)
def __init__(self, *args, **kwargs):
super(Test, self).__init__(*args, **kwargs)
print(self, type(self)) # 为啥这里 self 是空白?
class Test(object):
def __init__(self, name):
print(self) # 为啥这里 self 有东西?
self.name= name
test = Test(name='aaa') # 输出<Test object at 0x000002A3E4016F70>