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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -