Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8866561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:49:02+00:00 2026-06-14T16:49:02+00:00

I want to create a row in one of my databases’ tables every time

  • 0

I want to create a row in one of my databases’ tables every time a row in a particular table is created.
For example:

class Group(models.Model):
    name               = models.CharField(max_length=50)
    slug               = models.SlugField(unique = True)
    about              = models.TextField(blank = True, null=True)

every time a new row in this table is created, I want to add a new row in a Link class

class Link(models.Model):
    name               = models.CharField(max_length=50)
    slug               = models.SlugField(unique = True)
    location           = models.CharField(max_length= 200)

Where the group’s slug will be the a part of the Link’s location.
How can I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:49:03+00:00Added an answer on June 14, 2026 at 4:49 pm

    This is where the post_save signal comes in. You could add this to the bottom of your models.py:

    from django.db.models.signals import post_save
    
    def create_group_links(instance, created, **kwargs):
        if created:
            Link.objects.create(name='FOO', slug='BAR', location='LOC' + instance.slug)
    post_save.connect(create_group_links, sender=Group)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am created a dynamic table, now I want value of particular row and
I want to create a table structure with checkbox for each row and each
For every comma inside a certain MYSQL row, I want to create x html
I've got three tables: A, B and C. I want to create table A,
i am preparing my android apps in which i want to create two row
I want to create a scrollable row with thumbnails in a (smaller) container div.
If I have a DataTable and want to create a new row I first
I want to create a temp database in MySQL. The row's content are taken
I want ot create database table in which I can store application settings. Which
Having one table with users (which are registered) in mysql I simply want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.