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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:48:12+00:00 2026-05-16T06:48:12+00:00

In my application I have a model that looks like this: class Talk(models.Model): title

  • 0

In my application I have a model that looks 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')  
    def __unicode__(self):
    return '%s attended %s' %(unicode(self.membersAttended), unicode(self.talk))

And I want to be able to pull out all the results from the Event_Attendance model when i input a talk. This is so that i can get the names of the people that attended it. Every thing that I have tried has failed such as:

 a = Event_Attendance(talk="Meteors")

Has anyone else got any ideas?
Thanks in Advance,
Dean

  • 1 1 Answer
  • 1 View
  • 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-16T06:48:13+00:00Added an answer on May 16, 2026 at 6:48 am

    I think members_attended field in your EventAttendance model would be better as a ManyToManyField

    class EventAttendance(models.Model):
        talk = models.ForeignKey(Talk)
        members_attended = models.ManyToManyField(Member)
    

    That would make it easy to get the information you want.

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

Sidebar

Related Questions

I have a Django application. One of my models looks like this: class MyModel(models.Model):
I have a model that looks like this: from django.db import models from django.contrib.auth.models
I have model that looks like this: public class Lesson { public int Id
I have a django application which has two models like this: class MyModel(models.Model): name
I have a form class that looks like this: class ApplicationDetailsForm(ModelForm): worked_in_industry = forms.TypedChoiceField(coerce=int,
My application I have an application design that looks like this: web application layer
In my CakePHP application, I have a model like this: class Duck extends AppModel
In my application I have some table data that looks like this: <table> <tr>
In a client application I have a DBIx::Class model 'Todo' that can be linked
I have one grails application.In that I have one model class named Book. From

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.