Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Muhammadbugaje/NAMETS_Website/llms.txt

Use this file to discover all available pages before exploring further.

The Events module powers the full lifecycle of NAMETS activities — from weekly lectures to annual NAMETS Week celebrations. Admins create categorised events, control visibility, and members can add any event directly to their personal calendar via iCal export.

Data Models

EventCategory

Groups events into named segments (e.g., Lecture, Sports, Social). Each category carries a unique slug used for URL-based filtering.
FieldTypeNotes
nameCharFieldDisplay name, max 100 chars
slugSlugFieldURL-safe identifier, must be unique
descriptionTextFieldOptional summary of the category

Event

The primary model storing all event data.
FieldTypeNotes
titleCharFieldEvent name, max 200 chars
slugSlugFieldUnique URL identifier
descriptionCharFieldRich-text event body (HTML allowed)
categoryForeignKeyLinks to EventCategory; nullable
start_datetimeDateTimeFieldEvent start — timezone-aware
end_datetimeDateTimeFieldEvent end — timezone-aware
locationCharFieldVenue name or address, max 200 chars
imageCloudinaryFieldStored in Cloudinary events/ folder
is_featuredBooleanFieldHighlights the event on the homepage
is_activeBooleanFieldControls public visibility
send_emailBooleanFieldTriggers member email notification on save
created_atDateTimeFieldAuto-set on creation
updated_atDateTimeFieldAuto-updated on every save

Event Status Property

Each Event instance exposes a computed status property that compares the current server time against start_datetime and end_datetime:
@property
def status(self):
    if not self.start_datetime or not self.end_datetime:
        return "draft"
    now = timezone.now()
    if now < self.start_datetime:
        return "upcoming"
    elif now > self.end_datetime:
        return "past"
    else:
        return "ongoing"
Current time is before start_datetime. The event is scheduled but has not started.
Current time is between start_datetime and end_datetime. The event is in progress.
Current time is after end_datetime. The event has concluded.
Either start_datetime or end_datetime is missing. The event is incomplete.

URL Routes

All routes live under the /events/ prefix (app namespace: events).
NameURL PatternViewDescription
list/events/event_listFilterable list (upcoming/ongoing/past)
upcoming/events/upcoming/upcoming_eventsShortcut for upcoming events only
past/events/past/past_eventsArchive of concluded events
detail/events/<slug>/event_detailSingle event page
calendar_ics/events/calendar/<slug>/calendar_icsDownload .ics file for calendar apps

Filtering on the List View

The event_list view accepts two query parameters:
GET /events/?filter=upcoming&category=lecture
ParameterValuesDefault
filterupcoming, ongoing, pastupcoming
categoryAny EventCategory slugAll categories

iCal Export

The calendar_ics view generates a standard RFC 5545 .ics file so members can import any NAMETS event into Google Calendar, Apple Calendar, or Outlook.
# calendar_ics produces fields:
ical_event.add('summary',     event.title)
ical_event.add('dtstart',     event.start_datetime)
ical_event.add('dtend',       event.end_datetime)
ical_event.add('location',    event.location or 'TBA')
ical_event.add('description', plain_description)   # HTML tags stripped
ical_event.add('uid',         f'event-{event.id}@namets.org')
HTML tags and &nbsp; entities are automatically stripped from the description before embedding in the .ics file, ensuring compatibility with all calendar clients.
The response is served with:
  • Content-Type: text/calendar
  • Content-Disposition: attachment; filename="<slug>.ics"
Only events where is_active=True are accessible via this endpoint.

Admin Controls

Featuring an Event

Set is_featured = True to pin the event to the homepage hero or featured events section. Multiple events can be featured simultaneously.

Activating / Deactivating

Set is_active = False to hide an event from all public views and the iCal endpoint without deleting it.

Email Notifications

1

Create or edit the event in the Django admin

Fill in all required fields: title, slug, start/end datetimes, and location.
2

Enable the send_email flag

Tick the Send email notification checkbox before saving. This flag is per-event and one-shot — it will not re-send on subsequent saves.
3

Save the event

On save, the system dispatches an email to subscribed members informing them of the new event.
The send_email flag is intended for first-time notification only. Editing an already-notified event and re-ticking the flag may result in a duplicate email being sent to subscribers.

Build docs developers (and LLMs) love