Django Admin

/Tag: Django Admin

Override admin save method? – Add extra control to admin

By |2018-05-07T20:30:29+00:00mayo 3rd, 2018|Categories: Django|Tags: , |

I need to Override admin save method, and add extra control to admin save method. I will present you one of three available methods What I wanted to achieve was adding some control when saving a instance of a model from the admin, because it is the only place where it is going to be [...]

Ver campo Many2Many en Django Admin

By |2018-04-25T15:02:07+00:00abril 25th, 2018|Categories: Django, Python|Tags: , , |

Queremos ver un campo Many2Many en Django Admin Si lo agregamos al list_field, nos va a dar un error del estilo [crayon-5d2f54e402fb8888927450/] Lo que debemos hacer es agregar un campo que llame a una funcion. La documentación de como hacer esto : https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display Dejo un código de ejemplo. El modelo: [crayon-5d2f54e402fbd217866798/] Y el admin [crayon-5d2f54e402fc0376866831/] Con el campo [...]