0
請任何人都可以告訴我爲什麼我在下面保存這個模型時得到這個消息我環顧四周,發現有類似問題但有很多解決方案的人。有趣的數據庫錯誤
Exception Type: DatabaseError
Exception Value: value too long for type character varying(10)
Exception Location: /usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py in execute, line 52
class Stylesheet(models.Model):
text_color = models.CharField(max_length = 50,default = '#000')
a_visited = models.CharField(max_length = 50,default = '#000')
background = models.CharField(max_length = 50,default = '#000')
content_background_color = models.CharField(max_length = 50,default= '#000')
nav_color = models.CharField(max_length = 50,default = '#000')
nav_background = models.CharField(max_length = 50,default = '#000')
nav_gradient_start = models.CharField(max_length = 50,default = '#000')
nav_gradient_end = models.CharField(max_length = 50,default = '#000')
nav_a_color = models.CharField(max_length = 50,default = '#000')
nav_a_hover_color = models.CharField(max_length = 50,default = '#000')
nav_a_hover_background = models.CharField(max_length = 50,default = '#000')
nav_a_hover_gradient_start = models.CharField(max_length = 50,default = '#000')
nav_a_hover_gradient_end = models.CharField(max_length = 50,default = '#000')
slug = models.SlugField(max_length = 255,blank=True,null = True,editable=False)
class Meta:
db_table = 'stylesheet'
verbose_name = 'Style sheet'
verbose_name_plural = 'Style sheets'
def __unicode__(self):
return self.slug
def save(self):
super(Stylesheet, self).save()
你是什麼意思? 52? – user1940979 2013-02-13 03:13:17