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 8496887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:58:23+00:00 2026-06-10T23:58:23+00:00

I am new to Python and Django platforms. I am trying to design a

  • 0

I am new to Python and Django platforms. I am trying to design a general class so that other classes can use the general class to create the same model type. To explain better, I give an example

Let’s say my general class is

class Person(models.Model):
 name = models.CharField(max_length=20)
 lastname=models.CharField(max_length=20)
 job=models.CharField(max_length=20)
 salary=models.IntegerField()

I want to have a exactly same table with Person class for each person that I create.

In my mind is something like that….

Class Person1(models.Model) 
Person()
Class Person2(models.Model) 
Person()

So, thus each person table will have same model type with Person class. Could you please help me how to do that? OR Is there a way to 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-10T23:58:24+00:00Added an answer on June 10, 2026 at 11:58 pm

    I’m not sure I understand what you want or why you want that, but, I think the answer to your question is to use an Abstract Base Class.

    Example:

    class Person(models.Model):
       name = models.CharField(max_length=20)
       lastname = models.CharField(max_length=20)
       job = models.CharField(max_length=20)
       salary = models.IntegerField()
    
       class Meta:
           abstract = True
    
    
    class Person1(Person):
        ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm really new to Python and Django. I created a class in Python that
New to Python, have a simple, situational question: Trying to use BeautifulSoup to parse
Still new to python and django, though learning ;-) I have a view that
I'm new to Python / GAE / Django. I get that with GAE there
I am very new to Python/Django and programming in general. With the limited tools
I am new new in Python/Django and I try to create a website which
I'm very new to Python and Django so maybe someone can point me in
I'm new to Python and Django and am trying to get social auth (
I'm trying to use zc.buildout on a new Django project. I really like the
I'm new with Django and python. I have a problem. Is there a way,

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.