*def __str__(self):        return self.name <http://self.name>*



On Tue, Sep 10, 2019, 8:30 PM Elmaco7 <elmo_7...@hotmail.com> 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
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *from django.db import models# Create your models here.class
> Autore(models.Model):    nome = models.CharField(max_length=50)    cognome
> = models.CharField(max_length=50)def __str__(self):        return
> self.autore_textclass Meta:    verbose_name_plural = "Autori"class
> Genere(models.Model):    descrizione = models.CharField(max_length=30)def
> __str__(self):        return self.genere_textclass Meta:
> verbose_name_plural = "Generi"class Libro(models.Model):    titolo =
> models.CharField(max_length=200)    autore = models.ForeignKey(Autore,
> on_delete=models.CASCADE)    genere = models.ForeignKey(Genere,
> on_delete=models.CASCADE)def __str__(self):        return
> self.libro_textclass Meta:    verbose_name_plural = "Libri"*
>
>
> These are the results
>
>
>
>
> Can someone help me?
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c1941b52-7d2b-4b09-8ead-fce630b73757%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c1941b52-7d2b-4b09-8ead-fce630b73757%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKfjjGrMMEkg85LOVGhDeSes%3D4eMzoh%3DTn%2BwyS%2Bc5VxWMBMiPw%40mail.gmail.com.

Reply via email to