-
Notifications
You must be signed in to change notification settings - Fork 15
Update events page #696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
davehorsfall
wants to merge
4
commits into
main
Choose a base branch
from
feat/events-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Update events page #696
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2c01fac
draft event page updates
davehorsfall d2daa5c
Merge branch 'feat/governance' into feat/events-update
davehorsfall 7682eff
feat: database implimentation for events page #696
davehorsfall b788c45
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Generated by Django 6.0.6 on 2026-07-07 10:02 | ||
|
|
||
| from django.db import migrations | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('main', '0028_alter_toollanguagemethodology_options_and_more'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterModelOptions( | ||
| name='userproxy', | ||
| options={'verbose_name': 'User skills profile'}, | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Generated by Django 6.0.6 on 2026-07-07 10:02 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('main', '0029_alter_userproxy_options'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.CreateModel( | ||
| name='Event', | ||
| fields=[ | ||
| ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
| ('title', models.CharField(max_length=255)), | ||
| ('start_date', models.DateField()), | ||
| ('end_date', models.DateField(blank=True, null=True)), | ||
| ('location', models.CharField(blank=True, max_length=255)), | ||
| ('description', models.TextField(blank=True)), | ||
| ('event_link', models.URLField(blank=True, max_length=500, null=True)), | ||
| ('blog', models.URLField(blank=True, max_length=500, null=True)), | ||
| ('contributors', models.TextField(blank=True)), | ||
| ('image', models.CharField(blank=True, max_length=500)), | ||
| ], | ||
| options={ | ||
| 'ordering': ('-start_date', 'title'), | ||
| 'unique_together': {('title', 'start_date')}, | ||
| }, | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| """Init in models.""" | ||
|
|
||
| from .community_models import * # noqa: F403 | ||
| from .framework_models import * # noqa: F403 | ||
| from .user_models import * # noqa: F403 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| """Models for community-facing content, kept separate from the core framework.""" | ||
|
|
||
| from django.db import models | ||
|
|
||
|
|
||
| class Event(models.Model): | ||
| """Model for community events the DIRECT project has contributed to.""" | ||
|
|
||
| class Meta: | ||
| """Meta options for Event model.""" | ||
|
|
||
| ordering = ("-start_date", "title") | ||
| unique_together = ("title", "start_date") | ||
|
|
||
| title = models.CharField(max_length=255) | ||
| start_date = models.DateField() | ||
| end_date = models.DateField(blank=True, null=True) | ||
| location = models.CharField(max_length=255, blank=True) | ||
| description = models.TextField(blank=True) | ||
| event_link = models.URLField(max_length=500, blank=True, null=True) | ||
| blog = models.URLField(max_length=500, blank=True, null=True) | ||
| contributors = models.TextField(blank=True) | ||
| # Placeholder until image storage (static path vs. uploaded file) is decided. | ||
| image = models.CharField(max_length=500, blank=True) | ||
|
|
||
| def __str__(self) -> str: | ||
| """Return the event title and start date.""" | ||
| return f"{self.title} ({self.start_date})" |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| """Test suite for the community related models.""" | ||
|
|
||
| import pytest | ||
|
|
||
| from main.models import Event | ||
|
|
||
|
|
||
| @pytest.mark.django_db | ||
| def test_event_model(event: Event) -> None: | ||
| """Test the Event model.""" | ||
| assert event.title == "Collaborations Workshop" | ||
| assert str(event) == "Collaborations Workshop (2026-04-01)" | ||
| assert event.location == "Manchester" | ||
| assert event.description == "A workshop about the framework." | ||
| assert event.event_link == "https://example.com/event" | ||
| assert event.blog == "https://example.com/blog" | ||
| assert event.contributors == "Test Contributor" | ||
| assert event.image == "" | ||
|
|
||
|
|
||
| @pytest.mark.django_db | ||
| def test_event_ordering(event: Event) -> None: | ||
| """Test that events are ordered by most recent start date first.""" | ||
| earlier_event = Event.objects.create(title="Earlier Event", start_date="2023-01-01") | ||
| assert list(Event.objects.all()) == [event, earlier_event] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current EventsPageView tests only assert that an
eventslist exists, but they don’t validate the new fields (location, event_link, blog) or the missing-image behavior introduced here. Adding assertions for at least one row (including that empty image values don’t crash rendering) would help prevent regressions when the CSV schema evolves again.