django增加数据显示别名
django添加数据显示别名,在python3 和2
中不同,需要在设计表中添加如下:
python3 :
def __str__(self): data = self.city + ' ' + self.area return data
python2:
def __unicode__(self): return self.title
django添加数据显示别名,在python3 和2
中不同,需要在设计表中添加如下:
python3 :
def __str__(self): data = self.city + ' ' + self.area return data
python2:
def __unicode__(self): return self.title