Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

277
Vistas
Disable Delete for specific records of inline form Django Admin

I have a stacked inline form in my admin.py:

class XYZInline(admin.TabularInline):

   model = XYZ
   readonly_fields = ['modify', 'approver_page']
   form = XYZForm
   extra = 0

And I have it initialized in another model on the admin.py:

class SomeOhterModelAdmin(admin.ModelAdmin):
    inlines = [XYZInline]

What I want to do is disable the Delete checkbox in the Inline form for specific form records after checking the value of some of the inputs on the records of the form. If a certain input value matches, we disable the checkbox, otherwise we don't. How can we do this? And how can we check for input values of some of the fields of the form?

Some stackoverflow examples suggest adding a self.can_delete=False to the form initializer method. However, that would disable delete for all the form records of the Inline model.

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda