Hi, you should be using *list_display*! here's a sample that i have used in 
one of my project you too can compare *fields *and *list_display* try 
adding/removing column names from these elements

class ChoiceAdmin(admin.ModelAdmin):
    fields = ['choice_text', 'votes', 'question',]
    list_display = ('id','choice_text','votes','question',)

    list_filter = ['question'] 

again there's much better explanation 
here: 
https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#django.contrib.admin.ModelAdmin.fieldsets



Anish C.


On Tuesday, 11 July 2017 03:41:53 UTC+5:45, Informatico Neurodesarrollo 
wrote:
>
> Hello, I am a new programmer on Django. 
> I want in this class show, in the admin site of Django, the field "id", 
> I don't want create other field, if this could be possible. 
>
> class Tarjeton(models.Model): 
>      farmacia = models.ForeignKey(Farmacia, null=True, 
> on_delete=models.SET_NULL) 
>      MOTIVO = ( 
>          ('ACT', 'ACTIVO'), 
>          ('VEN', 'VENCIDO'), 
>          ('TRA', 'TRASLADO'), 
>          ('CER', 'CERRADO'), 
>          ('FAL', 'FALLECIDO'), 
>      ) 
>      TarjetonMotivo = models.CharField(max_length=3, choices=MOTIVO, 
> default='ACTIVO') 
>
>      class Admin:pass 
>
>      def __str__(self): 
>          return self.id 
>
> T.I.A. 
>
> -- 
>
> Jesús Reyes Piedra 
> Admin Red Neurodesarrollo,Cárdenas 
> La caja decía:"Requiere windows 95 o superior"... 
> Entonces instalé LINUX. 
>
>
> -- 
> Este mensaje le ha llegado mediante el servicio de correo electronico que 
> ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
> Nacional de Salud. La persona que envia este correo asume el compromiso de 
> usar el servicio a tales fines y cumplir con las regulaciones establecidas 
>
> Infomed: http://www.sld.cu/ 
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/556c987a-9428-4ba7-a966-e20a11b5e4c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to