python - Error in Django model ValueError -
i getting error on running python manage.py syncdb
, python manage.py migrate
the model working fine tried add model object , on running migrate commond displayed error.
so reverted original models.py still showing error.
my project's models.py following:
from django.db import models django.conf import settings class assignment(models.model): main_sub = models.charfield(max_length="60", choices=settings.subjects_list, default ='sub1') add_sub = models.charfield(max_length="60", choices=settings.subjects_list, default ='sub1') deadline = models.charfield(max_length="60", choices=settings.due_time_list, default ='12 hours') details = models.textfield() timestamp = models.datetimefield(auto_now_add=true, auto_now=false) username = models.charfield(max_length="60") def __unicode__(self): return self.username
and on running syncdb output is:
i have looked questions related error nothing helped.
subjects_list , due_time_list tuples:
#dropdown subjects subjects_list = ( ( 'sub1', 'subject1' ), ( 'sub2', 'subject2' ), ( 'sub3','subject3' ), ) #dropdown due_time due_time_list = ( ( '12 hours', '12 hours' ), ( '24 hours', '24 hours' ), ( '2 days','2 days' ), ( '3 days','3 days' ), ( '4 days','4 days' ), ( '5 days','5 days' ), ( '6 days','6 days' ), ( '1 week','1 week' ), ( 'more 1 week','more 1 week' ), )
Comments
Post a Comment