Skip to content
Snippets Groups Projects
Commit ff9a4c1d authored by Nadja Geisler's avatar Nadja Geisler :sunny:
Browse files

change type to category consistently

avoid clashes with python keyword
parent e13c5c45
No related branches found
No related tags found
No related merge requests found
......@@ -3,13 +3,13 @@
from django.contrib import admin
from AKModel.availability import Availability
from AKModel.models import Event, AKOwner, AKType, AKTrack, AKTag, AKRequirement, AK, Room, AKSlot
from AKModel.models import Event, AKOwner, AKCategory, AKTrack, AKTag, AKRequirement, AK, Room, AKSlot
admin.site.register(Event)
admin.site.register(AKOwner)
admin.site.register(AKType)
admin.site.register(AKCategory)
admin.site.register(AKTrack)
admin.site.register(AKTag)
admin.site.register(AKRequirement)
......@@ -17,7 +17,7 @@ admin.site.register(AKRequirement)
class AKAdmin(admin.ModelAdmin):
model = AK
list_display = ['name', 'short_name', 'type', 'is_wish']
list_display = ['name', 'short_name', 'category', 'is_wish']
def is_wish(self, obj):
return obj.wish
......
......@@ -10,7 +10,7 @@ from django.db import models
from django.utils.functional import cached_property
from django.utils.translation import gettext_lazy as _
from AKModel.models import Event, AKOwner, Room, AK, AKType
from AKModel.models import Event, AKOwner, Room, AK, AKCategory
zero_time = datetime.time(0, 0)
......@@ -21,7 +21,7 @@ zero_time = datetime.time(0, 0)
# remove serialization as requirements are not covered
# add translation
# add meta class
# enable availabilites for AKs and AKTypes
# enable availabilites for AKs and AKCategories
# add verbose names and help texts to model attributes
class Availability(models.Model):
"""The Availability class models when people or rooms are available for.
......@@ -65,14 +65,14 @@ class Availability(models.Model):
verbose_name=_('AK'),
help_text=_('AK whose availability this is'),
)
ak_type = models.ForeignKey(
to=AKType,
ak_category = models.ForeignKey(
to=AKCategory,
related_name='availabilities',
on_delete=models.CASCADE,
null=True,
blank=True,
verbose_name=_('AK Type'),
help_text=_('AK Type whose availability this is'),
verbose_name=_('AK Category'),
help_text=_('AK Category whose availability this is'),
)
start = models.DateTimeField()
end = models.DateTimeField()
......@@ -82,22 +82,23 @@ class Availability(models.Model):
room = getattr(self.room, 'name', None)
event = getattr(getattr(self, 'event', None), 'name', None)
ak = getattr(self.ak, 'name', None)
ak_type = getattr(self.ak_type, 'name', None)
return f'Availability(event={event}, person={person}, room={room}, ak={ak}, ak type={ak_type})'
ak_category = getattr(self.ak_category, 'name', None)
return f'Availability(event={event}, person={person}, room={room}, ak={ak}, ak category={ak_category})'
def __hash__(self):
return hash((getattr(self, 'event', None), self.person, self.room, self.ak, self.ak_type, self.start, self.end))
return hash(
(getattr(self, 'event', None), self.person, self.room, self.ak, self.ak_category, self.start, self.end))
def __eq__(self, other: 'Availability') -> bool:
"""Comparisons like ``availability1 == availability2``.
Checks if ``event``, ``person``, ``room``, ``ak``, ``ak_type``, ``start`` and ``end``
Checks if ``event``, ``person``, ``room``, ``ak``, ``ak_category``, ``start`` and ``end``
are the same.
"""
return all(
[
getattr(self, attribute, None) == getattr(other, attribute, None)
for attribute in ['event', 'person', 'room', 'ak', 'ak_type', 'start', 'end']
for attribute in ['event', 'person', 'room', 'ak', 'ak_category', 'start', 'end']
]
)
......
......@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-10-12 14:47+0000\n"
"POT-Creation-Date: 2019-10-18 11:09+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -11,13 +11,13 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: availability.py:38 models.py:19 models.py:32 models.py:82 models.py:123
#: models.py:141 models.py:161
#: availability.py:38 models.py:20 models.py:40 models.py:104 models.py:150
#: models.py:181 models.py:206
msgid "Event"
msgstr "Event"
#: availability.py:39 models.py:33 models.py:83 models.py:124 models.py:142
#: models.py:162
#: availability.py:39 models.py:41 models.py:105 models.py:151 models.py:182
#: models.py:207
msgid "Associated event"
msgstr "Zugehöriges Event"
......@@ -29,7 +29,7 @@ msgstr "Person"
msgid "Person whose availability this is"
msgstr "Person deren Verfügbarkeit hier abgebildet wird"
#: availability.py:56 models.py:145 models.py:155
#: availability.py:56 models.py:185 models.py:200
msgid "Room"
msgstr "Raum"
......@@ -37,7 +37,7 @@ msgstr "Raum"
msgid "Room whose availability this is"
msgstr "Raum dessen Verfügbarkeit hier abgebildet wird"
#: availability.py:65 models.py:127 models.py:154
#: availability.py:65 models.py:154 models.py:199
msgid "AK"
msgstr "AK"
......@@ -47,13 +47,13 @@ msgstr "AK"
msgid "AK whose availability this is"
msgstr "Verfügbarkeiten"
#: availability.py:74 models.py:49
msgid "AK Type"
msgstr "AK Typ"
#: availability.py:74 models.py:62
msgid "AK Category"
msgstr "AK Kategorie"
#: availability.py:75
msgid "AK Type whose availability this is"
msgstr "AK Typ dessen Verfügbarkeit hier abgebildet wird"
msgid "AK Category whose availability this is"
msgstr "AK Kategorie dessen Verfügbarkeit hier abgebildet wird"
#: availability.py:234
msgid "Availability"
......@@ -63,311 +63,322 @@ msgstr "Verfügbarkeit"
msgid "Availabilities"
msgstr "Verfügbarkeiten"
#: models.py:10 models.py:45 models.py:57 models.py:69 models.py:80
#: models.py:94 models.py:134
#: models.py:9 models.py:58 models.py:73 models.py:88 models.py:102
#: models.py:119 models.py:174
msgid "Name"
msgstr "Name"
#: models.py:11
#: models.py:10
msgid "Name or iteration of the event"
msgstr "Name oder Iteration des Events"
#: models.py:11
#, fuzzy
#| msgid "Short Name"
msgid "Short Form"
msgstr "Kurzer Name"
#: models.py:12
msgid "Short name of letters/numbers/dots/dashes/underscores used in URLs."
msgstr ""
#: models.py:13
msgid "Start"
msgstr "Start"
#: models.py:12
#: models.py:13
msgid "Time the event begins"
msgstr "Zeit zu der das Event beginnt"
#: models.py:13
#: models.py:14
msgid "End"
msgstr "Ende"
#: models.py:13
#: models.py:14
msgid "Time the event ends"
msgstr "Zeit zu der das Event endet"
#: models.py:14
#: models.py:15
msgid "Place"
msgstr "Ort"
#: models.py:15
#: models.py:16
msgid "City etc. the event takes place in"
msgstr "Stadt o.ä. in der das Event stattfindet"
#: models.py:16
#: models.py:17
msgid "Active State"
msgstr "Aktiver Status"
#: models.py:16
#: models.py:17
msgid "Marks currently active events"
msgstr "Markiert aktuell aktive Events"
#: models.py:20
#: models.py:21
msgid "Events"
msgstr "Events"
#: models.py:27
#: models.py:35
msgid "Nickname"
msgstr "Spitzname"
#: models.py:27
#: models.py:35
msgid "Name to identify an AK owner by"
msgstr "Name durch den eine AK Leitung identifiziert wird"
#: models.py:28
#: models.py:36
msgid "E-Mail Address"
msgstr "E-Mail Adresse"
#: models.py:28
#: models.py:36
msgid "Contact mail"
msgstr "Kontakt E-Mail"
#: models.py:29
#: models.py:37
msgid "Institution"
msgstr "Instutution"
#: models.py:29
#: models.py:37
msgid "Uni etc."
msgstr "Universität o.ä."
#: models.py:30 models.py:102
#: models.py:38 models.py:128
msgid "Web Link"
msgstr "Internet Link"
#: models.py:30
#: models.py:38
msgid "Link to Homepage"
msgstr "Link zu Homepage oder Webseite"
#: models.py:36
#: models.py:44
msgid "AK Owner"
msgstr "AK Leitung"
#: models.py:37
#: models.py:45
msgid "AK Owners"
msgstr "AK Leitungen"
#: models.py:45
msgid "Name of the AK Type"
msgstr "Name des AK Typs"
#: models.py:58
msgid "Name of the AK Category"
msgstr "Name des AK Kategorie"
#: models.py:46 models.py:58
#: models.py:59 models.py:74
msgid "Color"
msgstr "Farbe"
#: models.py:46 models.py:58
#: models.py:59 models.py:74
msgid "Color for displaying"
msgstr "Farbe für die Anzeige"
#: models.py:50
msgid "AK Types"
msgstr "AK Typen"
#: models.py:63
msgid "AK Categories"
msgstr "AK Kategorien"
#: models.py:57
#: models.py:73
msgid "Name of the AK Track"
msgstr "Name des AK Tracks"
#: models.py:61
#: models.py:77
msgid "AK Track"
msgstr "AK Track"
#: models.py:62
#: models.py:78
msgid "AK Tracks"
msgstr "AK Tracks"
#: models.py:69
#: models.py:88
msgid "Name of the AK Tag"
msgstr "Name das AK Tags"
#: models.py:72
#: models.py:91
msgid "AK Tag"
msgstr "AK Tag"
#: models.py:73
#: models.py:92
msgid "AK Tags"
msgstr "AK Tags"
#: models.py:80
#: models.py:102
msgid "Name of the Requirement"
msgstr "Name der Anforderung"
#: models.py:86
#: models.py:108
msgid "AK Requirement"
msgstr "AK Anforderung"
#: models.py:87
#: models.py:109
msgid "AK Requirements"
msgstr "AK Anforderungen"
#: models.py:94
#: models.py:119
msgid "Name of the AK"
msgstr "Name des AKs"
#: models.py:95
#: models.py:120
msgid "Short Name"
msgstr "Kurzer Name"
#: models.py:96
#: models.py:121
msgid "Name displayed in the schedule"
msgstr "Name zur Anzeige im AK Plan"
#: models.py:97
#: models.py:122
msgid "Description"
msgstr "Beschreibung"
#: models.py:97
#: models.py:122
msgid "Description of the AK"
msgstr "Beschreibung des AKs"
#: models.py:99
#: models.py:124
msgid "Owners"
msgstr "Leitungen"
#: models.py:99
#: models.py:125
msgid "Those organizing the AK"
msgstr "Menschen, die den AK organisieren und halten"
#: models.py:102
#: models.py:128
msgid "Link to wiki page"
msgstr "Link zur Wiki Seite"
#: models.py:104
msgid "Type"
msgstr "Typ"
#: models.py:130
msgid "Category"
msgstr "Kategorie"
#: models.py:104
msgid "Type of the AK"
msgstr "Typ des AKs"
#: models.py:131
msgid "Category of the AK"
msgstr "Kategorie des AKs"
#: models.py:105
#: models.py:132
msgid "Tags"
msgstr "Tags"
#: models.py:105
#: models.py:132
msgid "Tags provided by owners"
msgstr "Tags, die durch die AK Leitung vergeben wurden"
#: models.py:106
#: models.py:133
msgid "Track"
msgstr "Track"
#: models.py:107
#: models.py:134
msgid "Track the AK belongs to"
msgstr "Track zu dem der AK gehört"
#: models.py:109
#: models.py:136
msgid "Resolution Intention"
msgstr "Resolutionsabsicht"
#: models.py:110
#: models.py:137
msgid "Intends to submit a resolution"
msgstr "Beabsichtigt eine Resolution einzureichen"
#: models.py:111
#: models.py:138
msgid "Requirements"
msgstr "Anforderungen"
#: models.py:112
#: models.py:139
msgid "AK's Requirements"
msgstr "Anforderungen des AKs"
#: models.py:114
#: models.py:141
msgid "Conflicting AKs"
msgstr "AK Konflikte"
#: models.py:115
#: models.py:142
msgid "AKs that conflict and thus must not take place at the same time"
msgstr "AKs, die Konflikte haben und deshalb nicht gleichzeitig stattfinden dürfen"
msgstr ""
"AKs, die Konflikte haben und deshalb nicht gleichzeitig stattfinden dürfen"
#: models.py:116
#: models.py:143
msgid "Prerequisite AKs"
msgstr "Vorausgesetzte AKs"
#: models.py:117
#: models.py:144
msgid "AKs that should precede this AK in the schedule"
msgstr "AKS die im AK Plan vor diesem AK stattfinden müssen"
#: models.py:119
#: models.py:146
msgid "Internal Notes"
msgstr "Interne Notizen"
#: models.py:119
#: models.py:146
msgid "Notes to organizers"
msgstr "Notizen an die Organisator*innen"
#: models.py:121
#: models.py:148
msgid "Interest"
msgstr "Interesse"
#: models.py:121
#: models.py:148
msgid "Expected number of people"
msgstr "Erwartete Personenzahl"
#: models.py:128
#: models.py:155
msgid "AKs"
msgstr "AKs"
#: models.py:134
#: models.py:174
msgid "Name or number of the room"
msgstr "Name oder Nummer des Raums"
#: models.py:135
#: models.py:175
msgid "Building"
msgstr "Gebäude"
#: models.py:136
#: models.py:176
msgid "Name or number of the building"
msgstr "Name oder Nummer des Gebäudes"
#: models.py:137
#: models.py:177
msgid "Capacity"
msgstr "Kapazität"
#: models.py:137
#: models.py:177
msgid "Maximum number of people"
msgstr "Maximale Personenzahl"
#: models.py:138
#: models.py:178
msgid "Properties"
msgstr "Eigenschaften"
#: models.py:139
#: models.py:179
msgid "AK requirements fulfilled by the room"
msgstr "AK Anforderungen, die dieser Raum erfüllt"
#: models.py:146
#: models.py:186
msgid "Rooms"
msgstr "Räume"
#: models.py:154
#: models.py:199
msgid "AK being mapped"
msgstr "AK, der zugeordnet wird"
#: models.py:156
#: models.py:201
msgid "Room the AK will take place in"
msgstr "Raum in dem der AK stattfindet"
#: models.py:157
#: models.py:202
msgid "Slot Begin"
msgstr "Beginn des Slots"
#: models.py:157
#: models.py:202
msgid "Time and date the slot begins"
msgstr "Zeit und Datum zu der der AK beginnt"
#: models.py:158
#: models.py:203
msgid "Duration"
msgstr "Dauer"
#: models.py:159
#: models.py:204
msgid "Length in hours"
msgstr "Länge in Stunden"
#: models.py:165
#: models.py:210
msgid "AK Slot"
msgstr "AK Slot"
#: models.py:166
#: models.py:211
msgid "AK Slots"
msgstr "AK Slot"
# Generated by Django 2.2.6 on 2019-10-18 10:12
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AKModel', '0012_ak_wish'),
]
operations = [
migrations.AlterField(
model_name='ak',
name='type',
field=models.IntegerField(),
),
migrations.AlterField(
model_name='availability',
name='ak_type',
field=models.IntegerField(),
),
migrations.RenameModel(
old_name='AKType',
new_name='AKCategory',
),
migrations.RenameField(
model_name='ak',
old_name='type',
new_name='category',
),
migrations.RenameField(
model_name='availability',
old_name='ak_type',
new_name='ak_category',
),
migrations.AlterField(
model_name='ak',
name='category',
field=models.ForeignKey(help_text='Category of the AK', on_delete=django.db.models.deletion.PROTECT,
to='AKModel.AKCategory', verbose_name='Category'),
),
migrations.AlterField(
model_name='availability',
name='ak_category',
field=models.ForeignKey(blank=True, help_text='AK Category whose availability this is', null=True,
on_delete=django.db.models.deletion.CASCADE, related_name='availabilities',
to='AKModel.AKCategory', verbose_name='AK Category'),
),
]
......@@ -52,15 +52,15 @@ class AKOwner(models.Model):
return self.name
class AKType(models.Model):
""" An AKType describes the characteristics of an AK, e.g. content vs. recreational.
class AKCategory(models.Model):
""" An AKCategory describes the characteristics of an AK, e.g. content vs. recreational.
"""
name = models.CharField(max_length=64, unique=True, verbose_name=_('Name'), help_text=_('Name of the AK Type'))
name = models.CharField(max_length=64, unique=True, verbose_name=_('Name'), help_text=_('Name of the AK Category'))
color = models.CharField(max_length=7, blank=True, verbose_name=_('Color'), help_text=_('Color for displaying'))
class Meta:
verbose_name = _('AK Type')
verbose_name_plural = _('AK Types')
verbose_name = _('AK Category')
verbose_name_plural = _('AK Categories')
ordering = ['name']
def __str__(self):
......@@ -127,7 +127,8 @@ class AK(models.Model):
# TODO generate automatically
link = models.URLField(blank=True, verbose_name=_('Web Link'), help_text=_('Link to wiki page'))
type = models.ForeignKey(to=AKType, on_delete=models.PROTECT, verbose_name=_('Type'), help_text=_('Type of the AK'))
category = models.ForeignKey(to=AKCategory, on_delete=models.PROTECT, verbose_name=_('Category'),
help_text=_('Category of the AK'))
tags = models.ManyToManyField(to=AKTag, blank=True, verbose_name=_('Tags'), help_text=_('Tags provided by owners'))
track = models.ForeignKey(to=AKTrack, blank=True, on_delete=models.SET_NULL, null=True, verbose_name=_('Track'),
help_text=_('Track the AK belongs to'))
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-10-17 23:30+0000\n"
"POT-Creation-Date: 2019-10-18 11:09+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -35,10 +35,11 @@ msgstr "Wer?"
#: templates/AKSubmission/ak_detail.html:29
#: templates/AKSubmission/ak_list_table.html:6
msgid "Type"
msgstr "Typ"
msgid "Category"
msgstr "Kategorie"
#: templates/AKSubmission/ak_detail.html:31
#: templates/AKSubmission/ak_list.html:25
#: templates/AKSubmission/ak_list_table.html:6
msgid "Tags"
msgstr "Tags"
......@@ -63,6 +64,12 @@ msgstr "Raum"
msgid "AKs"
msgstr "AKs"
#: templates/AKSubmission/ak_list.html:18
#, fuzzy
#| msgid "Category"
msgid "Categories"
msgstr "Kategorie"
#: templates/AKSubmission/ak_list_table.html:6
msgid "Name"
msgstr "Name"
......
......@@ -26,7 +26,12 @@
<table class="table table-borderless">
<tr><td>{% trans "Who?" %}</td><td>{{ ak.owners_list }}</td></tr>
<tr><td>{% trans "Type" %}</td><td><a href="{% url 'submit:ak_list_by_type' event_slug=ak.event.slug type_pk=ak.type.pk %}"><span class="badge badge-primary">{{ ak.type }}</span></a></td></tr>
<tr>
<td>{% trans 'Category' %}</td>
<td>
<a href="{% url 'submit:ak_list_by_category' event_slug=ak.event.slug category_pk=ak.category.pk %}"><span
class="badge badge-primary">{{ ak.category }}</span></a></td>
</tr>
<tr>
<td>{% trans "Tags" %}</td>
<td>
......
......@@ -15,14 +15,15 @@
{% block content %}
<h1>{{ event.name }}: {% trans "AK Submission" %}</h1>
<b>Types:</b>
{% for type in types %}
<a href="{% url 'submit:ak_list_by_type' event_slug=event.slug type_pk=type.pk %}"><span class="badge badge-primary">{{ type }}</span></a>
<b>{% trans 'Categories' %}:</b>
{% for category in categories %}
<a href="{% url 'submit:ak_list_by_category' event_slug=event.slug category_pk=category.pk %}"><span
class="badge badge-primary">{{ category }}</span></a>
{% endfor %}
<br><br>
<b>Tags:</b>
<b>{% trans 'Tags' %}:</b>
{% for tag in tags.all %}
<a href="{% url 'submit:ak_list_by_tag' event_slug=event.slug tag_pk=tag.pk %}"><span class="badge badge-primary">{{ tag }}</span></a>
{% endfor %}
......
......@@ -3,7 +3,13 @@
<table id="akTable" class="table table-striped">
<thead>
<tr><th>{% trans "Name" %}</th><th>{% trans "Who?" %}</th><th>{% trans "Type" %}</th><th>{% trans "Tags" %}</th><th></th></tr>
<tr>
<th>{% trans "Name" %}</th>
<th>{% trans "Who?" %}</th>
<th>{% trans 'Category' %}</th>
<th>{% trans "Tags" %}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for ak in AKs %}
......@@ -16,7 +22,8 @@
{% endif %}
</td>
<td>{{ ak.owners_list }}</td>
<td><a href="{% url 'submit:ak_list_by_type' event_slug=event.slug type_pk=ak.type.pk %}"><span class="badge badge-primary">{{ ak.type }}</span></a></td>
<td><a href="{% url 'submit:ak_list_by_category' event_slug=event.slug category_pk=ak.category.pk %}"><span
class="badge badge-primary">{{ ak.category }}</span></a></td>
<td>
{% for tag in ak.tags.all %}
<a href="{% url 'submit:ak_list_by_tag' event_slug=event.slug tag_pk=tag.pk %}"><span class="badge badge-info">{{ tag }}</span></a>
......
......@@ -11,7 +11,7 @@ urlpatterns = [
path('', views.SubmissionOverviewView.as_view(), name='submission_overview'),
path('ak/<int:pk>', views.AKDetailView.as_view(), name='ak_detail'),
path('aks/', views.AKListView.as_view(), name='ak_list'),
path('aks/type/<int:type_pk>', views.AKListByTypeView.as_view(), name='ak_list_by_type'),
path('aks/category/<int:category_pk>', views.AKListByCategoryView.as_view(), name='ak_list_by_category'),
path('aks/tag/<int:tag_pk>', views.AKListByTagView.as_view(), name='ak_list_by_tag'),
])
),
......
from django.http import Http404
from django.utils.translation import gettext_lazy as _
from django.views.generic import ListView, DetailView
from AKModel.models import AK, AKType, AKTag
from AKModel.models import AK, AKCategory, AKTag
from AKModel.views import FilterByEventSlugMixin
from django.utils.translation import gettext_lazy as _
class SubmissionOverviewView(FilterByEventSlugMixin, ListView):
model = AK
context_object_name = "AKs"
template_name = "AKSubmission/submission_overview.html"
ordering = ["type"]
ordering = ['category']
class AKDetailView(DetailView):
......@@ -28,30 +27,30 @@ class AKListView(FilterByEventSlugMixin, ListView):
def get_context_data(self, *, object_list=None, **kwargs):
context = super().get_context_data(object_list=object_list, **kwargs)
context["types"] = AKType.objects.all()
context['categories'] = AKCategory.objects.all()
context["tags"] = AKTag.objects.all()
context["filter_condition_string"] = self.filter_condition_string
return context
class AKListByTypeView(AKListView):
type = None
class AKListByCategoryView(AKListView):
category = None
def get_queryset(self):
# Find type based on event slug
# Find category based on event slug
try:
self.type = AKType.objects.get(pk=self.kwargs['type_pk'])
self.filter_condition_string = f"{_('Type')} = {self.type.name}"
except AKType.DoesNotExist:
self.category = AKCategory.objects.get(pk=self.kwargs['category_pk'])
self.filter_condition_string = f"{_('Category')} = {self.category.name}"
except AKCategory.DoesNotExist:
raise Http404
return super().get_queryset().filter(type=self.type)
return super().get_queryset().filter(category=self.category)
class AKListByTagView(AKListView):
tag = None
def get_queryset(self):
# Find type based on event slug
# Find category based on event slug
try:
self.tag = AKTag.objects.get(pk=self.kwargs['tag_pk'])
self.filter_condition_string = f"{_('Tag')} = {self.tag.name}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment