Re: Problems with "Class Meta" and " __str__"

2019-09-11 Thread Ezequias Rocha
In your base model write a function like this (if your description field is called 'name'): def __str__(self): return self.name It works for me. PS: Take care of python identation. I don't know if your tabulation is the same you paste here in forum but it placed wrongly could

Re: Problems with "Class Meta" and " __str__"

2019-09-10 Thread 'Amitesh Sahay' via Django users
I guess you should define the Meta class just under the main class, ie. class Autore(models.Model):     nome = models.CharField(max_length=50)     cognome = models.CharField(max_length=50) class Meta:     verbose_name_plural = "Autori" Regards, Amitesh Sahay91-750 797 8619 On

Re: Problems with "Class Meta" and " __str__"

2019-09-10 Thread Doddahulugappa.B
*def __str__(self):return self.name * On Tue, Sep 10, 2019, 8:30 PM Elmaco7 wrote: > Hello, I do these models but the Django admin page doesn't read the "class > Meta" and " __str__". > This is the models.py document > > > > > > > > > > > > > > > > > > > > > > > > >

Problems with "Class Meta" and " __str__"

2019-09-10 Thread Elmaco7
Hello, I do these models but the Django admin page doesn't read the "class Meta" and " __str__". This is the models.py document *from django.db import models# Create your models here.class Autore(models.Model):nome = models.CharField(max_length=50)cognome =