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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:39:35+00:00 2026-05-28T05:39:35+00:00

I am trying to create a simple event scheduler for my campus, as an

  • 0

I am trying to create a simple event scheduler for my campus, as an exercise while learning Django. I want to define an event, which can be uniquely identified as a set of venue, speaker, and date. My first attempt is to do this using inheritance from multiple abstract base classes. I am still a beginner at coding, so I am not sure if I am doing it the right way. Is there a better way of doing the same thing?

Here is my first approach. Create abstract classes each for venue, speaker, date and then inherit all of them into a class called event. I want to do this way because the same venues and speakers will be used over and over again.

Another approach would be this, but it doesn’t seem to work well with venues and speakers which get reused many times:

class Event(models.Model):
    speaker=models.CharField(max_length=100)
    venue=models.CharField(max_length=400)
        date=models.DateTimeField('Event begins at')
    def __unicode__(self):
        return self.question

(I am not aware of all database techniques either.)

So, is it possible to create a single class that inherits from multiple abstract classes?

  • 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-28T05:39:36+00:00Added an answer on May 28, 2026 at 5:39 am

    (a) You can have multiple abstract base classes.

    (b) If you just need to collect up methods, then you don’t have to have these base classes be subclasses of Model.

    (c) Your event should not inherit from speaker etc, unless you want it to individually have all of the data members, and all of the functionality of those base classes. Instead, it should have a ForeignKey (or one of the other like fields) to an instance of each of those classes. You should use composition when you need to collect data together; you should only use inheritance when you need to customise behaviour.

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

Sidebar

Related Questions

I'm trying to create a simple custom validator for my project, and I can't
I was trying to create a very simple MySQL event and realized the action
I'm trying to create a simple event where, when the user hovers over a
I'm trying to create a simple event store using C# and [ServiceStack] Redis. public
I'm trying to create a simple flex4 project which involves some timers that trigger
I'm trying to create a simple smart textbox component in Flex, and I want
I am trying to create a simple function that can take a parameter and
I am trying to create a class called LinkButton, which is a simple class
I am trying to create a simple User Control (not WPF) in VS2008 which
I have a DataGridView for which I want to create an event handler for

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.