Use:
import datetime
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField(auto_now=True)
class Meta:
ordering = ['-pub_date']
def __str__(self):
return self.question_text
delete all objects of your paste migrates. and run: PS:[for this option must
delete the db]= python manage.py syncdb or use: makemigrations and then migrate
.
Att;
Adailton do nascimento
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/85fcfbf4-e4d9-4ad0-8f40-7790a0dc9752%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.