python - Django admin shows Post object in lieu of title -
really new django bear me :) running issue display posts titles in django admin.
i have tried both in python 3
class post(models.model): title = models.textfield(max_length=100) text = models.textfield(max_length=10000) tags = models.textfield(max_length=300) comments = models.textfield(max_length=400) def __str__(self): return self.title
and python 2
class post(models.model): title = models.textfield(max_length=100) text = models.textfield(max_length=10000) tags = models.textfield(max_length=300) comments = models.textfield(max_length=400) def __unicode__(self): return self.title
but unfortunately in django admin see "post object "in list of posts
thanks in advance help.
maybe can try this:
from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class post(models.model): title = models.charfield(max_length=255) text = models.textfield(max_length=10000) tags = models.textfield(max_length=300) comments = models.textfield(max_length=400) def __str__(self): return self.title
Comments
Post a Comment