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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:03:14+00:00 2026-05-26T22:03:14+00:00

I am using the django admin page to put questions into the database. My

  • 0

I am using the django admin page to put questions into the database.

My models.py is this:

from django.db import models

# Create your models here.

class Question(models.Model):
    question_name = models.CharField(max_length=200)
    question_type = models.CharField(max_length=20)
    def __unicode__(self):
            return self.question_name


class PythonQuestion(models.Model):
    question_no = models.ForeignKey(Question)
    question_text = models.TextField(max_length=1000)
    question_testcase = models.TextField(max_length=1000)
    question_difflevel = models.CharField(max_length=20)

I want these particular changes to my django-admin page:-

  1. As of now, when I am able to add the contents to both the Question model and PythonQuestion model from the admin page. What I want is that I should be able to write into the Question model and then be directed to a page where I can write data into the PythonQuestion model. My pages are up and running; all I need is the directing of links.

  2. I want to upload the answers to each questions which are in some file format(Doesn’t matter which format here.Lets assume a text file). How do I do that in the admin page?

  • 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-05-26T22:03:15+00:00Added an answer on May 26, 2026 at 10:03 pm

    Conceptually I think it might be. You can read more about it in the django docs but essentially Django has 3 types of inheritence; abstract, multitable and proxy which are all useful in different situations:

    • abstract inheritance is useful when your base class will never need to be instantiated itself (i.e. the base model has no table but it’s children all have tables)
    • multitable inheritance is useful when you have a base model that is useful in itself but can be extended (i.e. the base model has a table and it’s children all have tables)
    • proxy is useful when you want to extend only the functionality of a parent model (i.e. the base model has a table but it’s children don’t have tables)

    and a quick example (multi table):

    class Answer(models.Model):
        answer_text = models.CharField(...)
    
    class Question(models.Model):
        """What all questions have in common"""
        title = models.CharField(...)
        text = models.CharField(...)
        answer = models.ForeignKey(Answer)
    
    class PythonQuestion(Question):
        """What specifics a python question might have"""
        python_version = models.CharField(...)
    

    You will be able to enter all the data in one go in the django admin (this is the same for both multitable and abstract inheritence). Furthremore, You have an answer attached to every question. These answers can be uploaded via fixtures if needs be (or manually entered through the admin)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a database for a site i'm doing using Django as the admin
Using Django's built in models, how would one create a triple-join between three models.
I'm using django-admin-tools 0.4. Following the docs here so that I can get a
i'm new to django and im trying add a user using django admin page.
I am using django-admin-tool to customized my django admin page. my problem is, how
I am using Django-page-CMS Everything works fine However once I create my own views
I've been successfully using Django's admin panel for internal users for a while but
Can Django admin site select entries by a custom date range, i.e. using two
Using Django 1.1, I am trying to select the maximum value from a varchar
I'm working on a Django project, and I've created some custom admin views using

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.