摘要:
转。。。。。。。。。。。。。。。。。。。。。。。。。。。。。五、数据库访问1、基本数据访问[root@pxe-svr mysite]# ./manage.py shell>>> from books.models import Publisher#导入Publisher模型类>>> p1 = Publisher(name='Apress', address='2855 Telegraph Avenue', city='Berkeley', state_province='CA', country 阅读全文
摘要:
coercing to Unicode: need string or buffer, datetime.datetime foundcoercing to Unicode: need string or buffer, int found在models中,__unicode__(self) return self.datetime ------> return "%s" % self.datetime return self.int ---------->return "%d" % self.intdef __unicode__(self) 阅读全文