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

The Archive Base Latest Questions

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

I have following setup. from django.db import models from django.contrib.auth.models import User class Event(models.Model):

  • 0

I have following setup.

from django.db import models
from django.contrib.auth.models import User

class Event(models.Model):
    name = models.CharField(max_length=64)
    date = models.DateField()

ATTENDANCE_CHOICES = (
    ('A','Attending'),
    ('N','Absent'),
    ('L','Taken ill'),
)

class Attendance(models.Model):
    student = models.ForeignKey(User)
    event = models.ForeignKey(Event)
    status = models.CharField(max_length=1, choices=ATTENDANCE_CHOICES)

In a nutshell: Students(User) attend or doesn’t attend classes(Event), this is registered by Attendance.
Problem is adding those attendance records one at a time.

What I am looking for is a way to provide form for each class(each Event object) with list of all students and attendance status radio buttons or drop downs next to them.

Something like this:

https://i.stack.imgur.com/J2G4d.png

I have looked at many discussions about multiple/bulk record insertion via django admin and am beginning to wonder is this even possible with django admin or do I have to create such form from scratch? Either way, what would be the best (most django-ish) approach?

  • 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-29T06:15:12+00:00Added an answer on May 29, 2026 at 6:15 am

    “Is this even possible?” It’s possible right out of the box.

    Look into the django Admin app, Inlines, ModelForms, and the RadioSelect widget.

    class MyForm(forms.ModelForm):
        class Meta:
            model = Attendance
    
        def __init__(self, *args, **kwargs):
            super(MyForm, self).__init__(*args, **kwargs
            self.fields['status'].widget = forms.RadioSelect(choices=self.fields['status'].choices)
    
    class AttendanceInline(admin.TabularInline):
        model = Attendance
        form = MyForm
    
    class EventAdmin(admin.ModelAdmin):
         inlines = [AttendanceInline]
    
         def save_model(self, request, obj, form, change):
            obj.save()
            for user in User.objects.all():
                obj.attendance_set.create(user=user, status='')
                 # you should consider a null field or a possible choice for "Undecided"
    
    admin.site.register(Event, EventAdmin)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following model setup. from django.db import models from django.contrib.auth.models import User
I have these models set up in Django: class SourceBusiness(models.Model): source = models.CharField(max_length=100) ...(other
I have the following model set up: class UserProfile(models.Model): Additional attributes for users. url
So I've set up my django site with the following admin.py: import models from
I have a model which can be attached to to other models. class Attachable(models.Model):
I have the following setup for my Django based website: <VirtualHost 10.0.0.4> DocumentRoot /home/joel/www
I have the following setup: ASP.net 3.5 Web Site Project C# Class Library with
Have following setup: MainActivity class - extends activity MyLayout class - extends View Prefs
I have following setup, but when I put 1024 and replace all 512 with
I have the following setup: Code on my local machine (OS X) shared as

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.