Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!