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

  • Home
  • SEARCH
  • 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 946753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:58:17+00:00 2026-05-15T22:58:17+00:00

In my django app i have the admin site and I am trying to

  • 0

In my django app i have the admin site and I am trying to customise it so that i can keep adding people to the event attendance. My models look like this:

class Talk(models.Model):
title = models.CharField(max_length=200, primary_key=True)
speaker = models.CharField(max_length=200)
date_of_talk = models.DateField('date_of_talk')
def __unicode__(self):
        return self.title  

class Member(models.Model):
name = models.CharField(max_length=200)
telephone_number = models.CharField(max_length=200)
email_address = models.CharField(max_length=200)
membership_type = models.CharField(max_length=1, choices=MEMBERSHIP_TYPES)
membership_number = models.CharField(max_length=200, primary_key=True)
def __unicode__(self):
        return self.name

class Event_Attendance(models.Model):
talk = models.ForeignKey('Talk')
membersAttended = models.ForeignKey('Member') 

I want to be able to configure the admin site so that i can keep adding members to the talk in the event_attendance object. I have one talk with many members. How would i do this? I also want the maximum number of membersAttended in the event_attendance object to be equal to the number of members.
Thanks in Advance,
Dean

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

    You need a ManyToManyField on Member using the “through” argument:

    class Member(models.Model):
        [...]
        attending = models.ManyToManyField(Talk, through=Event_Attendance)
    

    To take care of not allowing more than the maximum number of Members attend an event, you can just enforce a uniqueness constraint on Event_Attendance like so:

    class Event_Attendance(models.Model):
        [...]
        class Meta:
            unique_together = ('talk', 'membersAttended')
    

    With that you can be sure that each member can only attend a talk once, and you can happily query across any of your models to gain access to the data you’re looking for.

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

Sidebar

Related Questions

I have a Django app that gets it's data completely from an external source
I have a Django app that use a django-tagging. I need to port this
I have a django app with models as follows: A Question model An Answer
I have a django app that I made and have implemented a plist into
I have a Django app and I am trying to perform transactions over multiple
I have a Django app where multiple teams upload content that will be parsed.
I have the following stack trace when trying to access the django admin default
I've had the admin site working for my django app before but now I
I have three model classes in a Django app: class Folder(models.Model): ... folder =
I have a Django app hosted in the cloud (Heroku if that makes a

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.