Skip to content
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

our partners, partner with us pages done, added event filters #34

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions app/core/migrations/0007_partnertype_partner_partner_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by Django 4.2.7 on 2024-07-25 23:16

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('core', '0006_delete_hotsearchablepage'),
]

operations = [
migrations.CreateModel(
name='PartnerType',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('type_name', models.CharField()),
],
options={
'verbose_name_plural': 'Partner Types',
},
),
migrations.AddField(
model_name='partner',
name='partner_type',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='core.partnertype'),
),
]
26 changes: 25 additions & 1 deletion app/core/models.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
from django import forms
from django.db import models

from wagtail.models import Page
from wagtail.fields import StreamField
from wagtail.blocks import CharBlock, StreamBlock, StructBlock, URLBlock, RichTextBlock, PageChooserBlock

from wagtail.snippets.models import register_snippet
from wagtail.admin.panels import FieldPanel, MultiFieldPanel, InlinePanel


@register_snippet
class PartnerType(models.Model):
type_name = models.CharField()

panels = [
FieldPanel("type_name")
]

def __str__(self):
return self.type_name

class Meta:
verbose_name_plural = "Partner Types"


@register_snippet
class Partner(models.Model):
partner_name = models.CharField()
Expand All @@ -18,11 +34,19 @@ class Partner(models.Model):
help_text="Partner logo"
)
partner_url = models.URLField(blank=True)
partner_type = models.ForeignKey(
'core.PartnerType',
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+'
)

panels = [
FieldPanel("partner_name"),
FieldPanel("partner_logo"),
FieldPanel("partner_url"),
FieldPanel("partner_type", widget=forms.RadioSelect),
]

def __str__(self):
Expand Down
44 changes: 44 additions & 0 deletions app/events/migrations/0005_eventcategory_eventhosttype_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Generated by Django 4.2.7 on 2024-07-26 18:42

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('mapping_hubs', '0013_alter_mappinghubprojectspage_black_box_link_text_and_more'),
('events', '0004_eventownerpage_keyword_search_hint_and_more'),
]

operations = [
migrations.CreateModel(
name='EventCategory',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('category_name', models.CharField()),
],
),
migrations.CreateModel(
name='EventHostType',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('type_name', models.CharField()),
],
),
migrations.AddField(
model_name='individualeventpage',
name='event_region_hub',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='mapping_hubs.individualmappinghubpage'),
),
migrations.AddField(
model_name='individualeventpage',
name='event_category',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='events.eventcategory'),
),
migrations.AddField(
model_name='individualeventpage',
name='event_host_type',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='events.eventhosttype'),
),
]
27 changes: 27 additions & 0 deletions app/events/migrations/0006_alter_eventcategory_options_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 4.2.7 on 2024-07-26 18:56

from django.db import migrations
import modelcluster.fields


class Migration(migrations.Migration):

dependencies = [
('events', '0005_eventcategory_eventhosttype_and_more'),
]

operations = [
migrations.AlterModelOptions(
name='eventcategory',
options={'verbose_name_plural': 'Event Categories'},
),
migrations.RemoveField(
model_name='individualeventpage',
name='event_category',
),
migrations.AddField(
model_name='individualeventpage',
name='event_categories',
field=modelcluster.fields.ParentalManyToManyField(blank=True, to='events.eventcategory'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.7 on 2024-07-26 19:32

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('events', '0006_alter_eventcategory_options_and_more'),
]

operations = [
migrations.AddField(
model_name='eventownerpage',
name='event_categories_title',
field=models.CharField(default='Categories'),
),
migrations.AddField(
model_name='eventownerpage',
name='event_region_hub_title',
field=models.CharField(default='Region Hub'),
),
]
32 changes: 32 additions & 0 deletions app/events/migrations/0008_alter_eventhosttype_options_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 4.2.7 on 2024-07-26 21:28

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('events', '0007_eventownerpage_event_categories_title_and_more'),
]

operations = [
migrations.AlterModelOptions(
name='eventhosttype',
options={'verbose_name_plural': 'Event Host Types'},
),
migrations.AddField(
model_name='eventownerpage',
name='category_select',
field=models.CharField(default='Filter by category'),
),
migrations.AddField(
model_name='eventownerpage',
name='filter_by_country',
field=models.CharField(default='Filter by country'),
),
migrations.AddField(
model_name='eventownerpage',
name='host_type_select',
field=models.CharField(default='Filter by host type'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.2.7 on 2024-07-26 21:29

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('events', '0008_alter_eventhosttype_options_and_more'),
]

operations = [
migrations.AlterField(
model_name='eventownerpage',
name='category_select',
field=models.CharField(default='Filter by Category'),
),
migrations.AlterField(
model_name='eventownerpage',
name='filter_by_country',
field=models.CharField(default='Filter by Country'),
),
migrations.AlterField(
model_name='eventownerpage',
name='host_type_select',
field=models.CharField(default='Filter by Host Type'),
),
]
Loading