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

184
Vistas
On adding a Model using the Admin Panel in Django, is there a way to implement altering other Models?

I am using the standard Admin Panel in Django that has a Model, Product, that contains its information. the Product has a TextField() Summary of words.

I would like to implement a Keyword model that has a single word. The idea is that the Keyword would be applied to multiple Products if the Product has the Keyword's word in its Summary.

I am trying to implement that when the Admin in the Admin panel adds a Keyword model, the server would automatically assign each Product that Keyword.

The issue is that I do not know how to edit the Admin Panel's add function to edit other models upon adding one model. My current understanding in Django is that you could create a custom view to add a Keyword, but I would like to have the option to implement it in the Django Admin Panel as well. Products should have multiple Keywords.

Here is my models.py:

    from django.db import models

    class Product(models.Model):
        id = models.BigAutoField(primary_key=True)
        product_summary = models.TextField() # Contains a paragraph of words describing the product
    class Keyword(models.Model):
        # Used for searching Products by unique keywords to display, like tags.
        keyword = models.CharField(max_length=100)
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I think you can use the save() function and extend them in your model to do what you want. but this isn't really good for performance since you want to query other objects.
Another way would be to use django signals to signal the other objects.

over 4 years ago · Santiago Trujillo Denunciar
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