请任何人告诉我为什么在下面保存此模型时收到此消息我环顾四周发现有类似问题但有很多解决方案的人。
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()