Django

College Event Registration Website

CampusConnect Introduction and Setup Configuring settings file for template, static and media files Setting up Tailwind Creating Custom User Model Creating Super User for CampusConnect Registering Custom User Model Search and Filter for User Model Serving Media Files During Development Categorizing Departments Linking Department with HOD Creating Abstract Model for Event Creating Model for Workshop Customizing Admin Page for Workshop Update in Model AbstractEvent Adding Instructor for Workshop Instructor Model Admin Page Adding Poster Field in Abstract Event Providing Access to HOD Access Update for HOD Restricting HOD Access to Particular Department AbstractEvent On Spot Registration Field Creating Workshop Object Creating and Linking Home Page Displaying Workshop on Home Page Styling Home Page Adding Workshop Detail Page Link Workshop Detail Page Workshop Detail Page Styling Workshop Instructor Details Workshop Detail Contact Contact Admin Page Many to Many Field for Contact Displaying Contact on Workshop Detail Page Adding Title for Workshop Detail Page Adding Gallery for Workshop Workshop Gallery Admin Page Displaying Gallery Images on Website Through Context Displaying Gallery Images on Website through template tags Authentication for users User Registration User Registration Submission Logout Functionality For User Login Functionality for User Model For Workshop Registration Workshop Registration Admin Page Register Workshop Function Register Button in Workshop Page Validations Before Workshop Registration Workshop Registration Closed Validaiton User Already Registered for Workshop Validation Workshop Registration Report From Admin Page Export using Library in Django Admin Extending Abstract Event for Hackathons

Displaying Contact on Workshop Detail Page

The ManyToManyField created for Contact, can be displayed on the webpage that are mapped with the particular workshop.

To do this, the event/workshop_detail.html template should be edited as follows :

{% with workshop.contacts.all as contacts %}
        {% if contacts %}
        
            <h2 class="text-3xl text-orange-500 font-semibold mb-4 text-center mt-2">Contact</h2>

        {% endif %}
        <div class="bg-gray-700 p-6 mb-6 rounded-lg">

            <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
    
                <div class="mb-4 lg:col-span-1">
                    <h3 class="text-xl font-semibold mb-2">Email</h3>
                    <p class="text-gray-200">{{ workshop.mail_id }}</p>
                </div>
            
                <div class="mb-4">
                        <div class="grid grid-cols-1 md:lg:grid-cols-2 gap-4 justify">
                            {% for contact in contacts %}
                                <div>
                                    <h3 class="text-xl font-semibold mb-2">{{ contact.name }}<br>({{ contact.get_designation_display }})</h3>
                                    <p class="text-gray-200">{{ contact.number }}</p>
                                </div>
                            {% endfor %}
                        </div>
                    
                </div>
            </div>
            
    
        </div>
    {% endwith %}

After adding this, it will also display a contact section in the webpage. The section can be further extended with better styling or responsiveness. alt text As part of this course, we will continue to add further details that would be nice if it is there before the registration.