Skip to content
Snippets Groups Projects
Commit 4471a4a0 authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Improve Model

Add dependency django-timezone-field
Add timezone field to Event
Introduce i18n for default_slot field
Add new and missing translations
Add title property to Room (for better access of combined building + name form)
parent c3925531
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-10-30 13:18+0000\n"
"POT-Creation-Date: 2020-03-01 14:21+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"
......@@ -23,17 +23,17 @@ msgstr "Ist ein Wunsch"
msgid "Is not a wish"
msgstr "Ist kein Wunsch"
#: admin.py:53
#: admin.py:54
msgid "Export to wiki syntax"
msgstr "In Wiki-Syntax exportieren"
#: availability.py:38 models.py:30 models.py:51 models.py:103 models.py:121
#: models.py:152 models.py:201 models.py:237 models.py:263
#: availability.py:38 models.py:37 models.py:58 models.py:110 models.py:128
#: models.py:159 models.py:208 models.py:244 models.py:274
msgid "Event"
msgstr "Event"
#: availability.py:39 models.py:52 models.py:104 models.py:122 models.py:153
#: models.py:202 models.py:238 models.py:264
#: availability.py:39 models.py:59 models.py:111 models.py:129 models.py:160
#: models.py:209 models.py:245 models.py:275
msgid "Associated event"
msgstr "Zugehöriges Event"
......@@ -45,7 +45,7 @@ msgstr "Person"
msgid "Person whose availability this is"
msgstr "Person deren Verfügbarkeit hier abgebildet wird"
#: availability.py:56 models.py:241 models.py:256
#: availability.py:56 models.py:248 models.py:267
msgid "Room"
msgstr "Raum"
......@@ -53,17 +53,15 @@ msgstr "Raum"
msgid "Room whose availability this is"
msgstr "Raum dessen Verfügbarkeit hier abgebildet wird"
#: availability.py:65 models.py:205 models.py:255
#: availability.py:65 models.py:212 models.py:266
msgid "AK"
msgstr "AK"
#: availability.py:66
#, fuzzy
#| msgid "Availabilities"
msgid "AK whose availability this is"
msgstr "Verfügbarkeiten"
#: availability.py:74 models.py:107
#: availability.py:74 models.py:114
msgid "AK Category"
msgstr "AK Kategorie"
......@@ -79,70 +77,86 @@ msgstr "Verfügbarkeit"
msgid "Availabilities"
msgstr "Verfügbarkeiten"
#: models.py:12 models.py:98 models.py:118 models.py:136 models.py:150
#: models.py:167 models.py:230
#: models.py:14 models.py:105 models.py:125 models.py:143 models.py:157
#: models.py:174 models.py:237
msgid "Name"
msgstr "Name"
#: models.py:13
#: models.py:15
msgid "Name or iteration of the event"
msgstr "Name oder Iteration des Events"
#: models.py:14
#, fuzzy
#| msgid "Short Name"
#: models.py:16
msgid "Short Form"
msgstr "Kurzer Name"
#: models.py:15
#: models.py:17
msgid "Short name of letters/numbers/dots/dashes/underscores used in URLs."
msgstr ""
"Kurzname bestehend aus Buchstaben, Nummern, Punkten und Unterstrichen zur "
"Nutzung in URLs"
#: models.py:16
#: models.py:19
msgid "Place"
msgstr "Ort"
#: models.py:20
msgid "City etc. the event takes place in"
msgstr "Stadt o.ä. in der das Event stattfindet"
#: models.py:22
msgid "Time Zone"
msgstr "Zeitzone"
#: models.py:22
msgid "Time Zone where this event takes place in"
msgstr "Zeitzone in der das Event stattfindet"
#: models.py:23
msgid "Start"
msgstr "Start"
#: models.py:16
#: models.py:23
msgid "Time the event begins"
msgstr "Zeit zu der das Event beginnt"
#: models.py:17
#: models.py:24
msgid "End"
msgstr "Ende"
#: models.py:17
#: models.py:24
msgid "Time the event ends"
msgstr "Zeit zu der das Event endet"
#: models.py:18
msgid "Place"
msgstr "Ort"
#: models.py:19
msgid "City etc. the event takes place in"
msgstr "Stadt o.ä. in der das Event stattfindet"
#: models.py:20
#: models.py:26
msgid "Active State"
msgstr "Aktiver Status"
#: models.py:20
#: models.py:26
msgid "Marks currently active events"
msgstr "Markiert aktuell aktive Events"
#: models.py:22
#: models.py:28
msgid "Base URL"
msgstr "URL-Prefix"
#: models.py:22
#: models.py:28
msgid "Prefix for wiki link construction"
msgstr "Prefix für die automatische Generierung von Wiki-Links"
#: models.py:26
#: models.py:29
msgid "Default Slot Length"
msgstr "Standardslotlänge"
#: models.py:30
msgid "Default length in hours that is assumed for AKs in this event."
msgstr "Standardlänge von Slots (in Stunden) für dieses Event"
#: models.py:32
msgid "Contact email address"
msgstr "E-Mail Kontaktadresse"
#: models.py:27
#: models.py:34
msgid ""
"An email address that is displayed on every page and can be used for all "
"kinds of questions"
......@@ -150,288 +164,292 @@ msgstr ""
"Eine Mailadresse die auf jeder Seite angezeigt wird und für alle Arten von "
"Fragen genutzt werden kann"
#: models.py:31
#: models.py:38
msgid "Events"
msgstr "Events"
#: models.py:45
#: models.py:52
msgid "Nickname"
msgstr "Spitzname"
#: models.py:45
#: models.py:52
msgid "Name to identify an AK owner by"
msgstr "Name durch den eine AK Leitung identifiziert wird"
#: models.py:46
#: models.py:53
msgid "Slug"
msgstr "Slug"
#: models.py:47
#: models.py:54
msgid "Slug for URL generation"
msgstr "Slug für URL-Generierung"
#: models.py:48
#: models.py:55
msgid "Institution"
msgstr "Instutution"
#: models.py:48
#: models.py:55
msgid "Uni etc."
msgstr "Universität o.ä."
#: models.py:49 models.py:176
#: models.py:56 models.py:183
msgid "Web Link"
msgstr "Internet Link"
#: models.py:49
#: models.py:56
msgid "Link to Homepage"
msgstr "Link zu Homepage oder Webseite"
#: models.py:55
#: models.py:62
msgid "AK Owner"
msgstr "AK Leitung"
#: models.py:56
#: models.py:63
msgid "AK Owners"
msgstr "AK Leitungen"
#: models.py:98
#: models.py:105
msgid "Name of the AK Category"
msgstr "Name des AK Kategorie"
#: models.py:99 models.py:119
#: models.py:106 models.py:126
msgid "Color"
msgstr "Farbe"
#: models.py:99 models.py:119
#: models.py:106 models.py:126
msgid "Color for displaying"
msgstr "Farbe für die Anzeige"
#: models.py:100 models.py:170
#: models.py:107 models.py:177
msgid "Description"
msgstr "Beschreibung"
#: models.py:101
#: models.py:108
msgid "Short description of this AK Category"
msgstr "Beschreibung der AK-Kategorie"
#: models.py:108
#: models.py:115
msgid "AK Categories"
msgstr "AK Kategorien"
#: models.py:118
#: models.py:125
msgid "Name of the AK Track"
msgstr "Name des AK Tracks"
#: models.py:125
#: models.py:132
msgid "AK Track"
msgstr "AK Track"
#: models.py:126
#: models.py:133
msgid "AK Tracks"
msgstr "AK Tracks"
#: models.py:136
#: models.py:143
msgid "Name of the AK Tag"
msgstr "Name das AK Tags"
#: models.py:139
#: models.py:146
msgid "AK Tag"
msgstr "AK Tag"
#: models.py:140
#: models.py:147
msgid "AK Tags"
msgstr "AK Tags"
#: models.py:150
#: models.py:157
msgid "Name of the Requirement"
msgstr "Name der Anforderung"
#: models.py:156
#: models.py:163
msgid "AK Requirement"
msgstr "AK Anforderung"
#: models.py:157
#: models.py:164
msgid "AK Requirements"
msgstr "AK Anforderungen"
#: models.py:167
#: models.py:174
msgid "Name of the AK"
msgstr "Name des AKs"
#: models.py:168
#: models.py:175
msgid "Short Name"
msgstr "Kurzer Name"
#: models.py:169
#: models.py:176
msgid "Name displayed in the schedule"
msgstr "Name zur Anzeige im AK Plan"
#: models.py:170
#: models.py:177
msgid "Description of the AK"
msgstr "Beschreibung des AKs"
#: models.py:172
#: models.py:179
msgid "Owners"
msgstr "Leitungen"
#: models.py:173
#: models.py:180
msgid "Those organizing the AK"
msgstr "Menschen, die den AK organisieren und halten"
#: models.py:176
#: models.py:183
msgid "Link to wiki page"
msgstr "Link zur Wiki Seite"
#: models.py:178
#: models.py:185
msgid "Category"
msgstr "Kategorie"
#: models.py:179
#: models.py:186
msgid "Category of the AK"
msgstr "Kategorie des AKs"
#: models.py:180
#: models.py:187
msgid "Tags"
msgstr "Tags"
#: models.py:180
#: models.py:187
msgid "Tags provided by owners"
msgstr "Tags, die durch die AK Leitung vergeben wurden"
#: models.py:181
#: models.py:188
msgid "Track"
msgstr "Track"
#: models.py:182
#: models.py:189
msgid "Track the AK belongs to"
msgstr "Track zu dem der AK gehört"
#: models.py:184
#: models.py:191
msgid "Resolution Intention"
msgstr "Resolutionsabsicht"
#: models.py:185
#: models.py:192
msgid "Intends to submit a resolution"
msgstr "Beabsichtigt eine Resolution einzureichen"
#: models.py:186
#: models.py:193
msgid "Present this AK"
msgstr "AK Präsentieren"
#: models.py:187
#: models.py:194
msgid "Present results of this AK"
msgstr "Die Ergebnisse dieses AKs vorstellen"
#: models.py:189
#: models.py:196
msgid "Requirements"
msgstr "Anforderungen"
#: models.py:190
#: models.py:197
msgid "AK's Requirements"
msgstr "Anforderungen des AKs"
#: models.py:192
#: models.py:199
msgid "Conflicting AKs"
msgstr "AK Konflikte"
#: models.py:193
#: models.py:200
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"
#: models.py:194
#: models.py:201
msgid "Prerequisite AKs"
msgstr "Vorausgesetzte AKs"
#: models.py:195
#: models.py:202
msgid "AKs that should precede this AK in the schedule"
msgstr "AKS die im AK Plan vor diesem AK stattfinden müssen"
#: models.py:197
#: models.py:204
msgid "Internal Notes"
msgstr "Interne Notizen"
#: models.py:197
#: models.py:204
msgid "Notes to organizers"
msgstr "Notizen an die Organisator*innen"
#: models.py:199
#: models.py:206
msgid "Interest"
msgstr "Interesse"
#: models.py:199
#: models.py:206
msgid "Expected number of people"
msgstr "Erwartete Personenzahl"
#: models.py:206
#: models.py:213
msgid "AKs"
msgstr "AKs"
#: models.py:230
#: models.py:237
msgid "Name or number of the room"
msgstr "Name oder Nummer des Raums"
#: models.py:231
#: models.py:238
msgid "Building"
msgstr "Gebäude"
#: models.py:232
#: models.py:239
msgid "Name or number of the building"
msgstr "Name oder Nummer des Gebäudes"
#: models.py:233
#: models.py:240
msgid "Capacity"
msgstr "Kapazität"
#: models.py:233
#: models.py:240
msgid "Maximum number of people"
msgstr "Maximale Personenzahl"
#: models.py:234
#: models.py:241
msgid "Properties"
msgstr "Eigenschaften"
#: models.py:235
#: models.py:242
msgid "AK requirements fulfilled by the room"
msgstr "AK Anforderungen, die dieser Raum erfüllt"
#: models.py:242
#: models.py:249
msgid "Rooms"
msgstr "Räume"
#: models.py:255
#: models.py:266
msgid "AK being mapped"
msgstr "AK, der zugeordnet wird"
#: models.py:257
#: models.py:268
msgid "Room the AK will take place in"
msgstr "Raum in dem der AK stattfindet"
#: models.py:258
#: models.py:269
msgid "Slot Begin"
msgstr "Beginn des Slots"
#: models.py:258
#: models.py:269
msgid "Time and date the slot begins"
msgstr "Zeit und Datum zu der der AK beginnt"
#: models.py:260
#: models.py:271
msgid "Duration"
msgstr "Dauer"
#: models.py:261
#: models.py:272
msgid "Length in hours"
msgstr "Länge in Stunden"
#: models.py:267
#: models.py:277
msgid "Last update"
msgstr "Letzte Aktualisierung"
#: models.py:280
msgid "AK Slot"
msgstr "AK Slot"
#: models.py:268
#: models.py:281
msgid "AK Slots"
msgstr "AK Slot"
#: models.py:282
#: models.py:295
msgid "Not scheduled yet"
msgstr "Noch nicht geplant"
......
This diff is collapsed.
......@@ -5,6 +5,7 @@ import itertools
from django.db import models
from django.utils.text import slugify
from django.utils.translation import gettext_lazy as _
from timezone_field import TimeZoneField
class Event(models.Model):
......@@ -14,15 +15,19 @@ class Event(models.Model):
help_text=_('Name or iteration of the event'))
slug = models.SlugField(max_length=32, unique=True, verbose_name=_('Short Form'),
help_text=_('Short name of letters/numbers/dots/dashes/underscores used in URLs.'))
start = models.DateTimeField(verbose_name=_('Start'), help_text=_('Time the event begins'))
end = models.DateTimeField(verbose_name=_('End'), help_text=_('Time the event ends'))
place = models.CharField(max_length=128, blank=True, verbose_name=_('Place'),
help_text=_('City etc. the event takes place in'))
timezone = TimeZoneField(default='Europe/Berlin', display_GMT_offset=True, blank=False,
verbose_name=_('Time Zone'), help_text=_('Time Zone where this event takes place in'))
start = models.DateTimeField(verbose_name=_('Start'), help_text=_('Time the event begins'))
end = models.DateTimeField(verbose_name=_('End'), help_text=_('Time the event ends'))
active = models.BooleanField(verbose_name=_('Active State'), help_text=_('Marks currently active events'))
base_url = models.URLField(verbose_name=_("Base URL"), help_text=_("Prefix for wiki link construction"), blank=True)
default_slot = models.DecimalField(max_digits=4, decimal_places=2, default=2, verbose_name='Default Slot Length',
help_text='Default length in hours that is assumed for AKs in this event.')
default_slot = models.DecimalField(max_digits=4, decimal_places=2, default=2, verbose_name=_('Default Slot Length'),
help_text=_('Default length in hours that is assumed for AKs in this event.'))
contact_email = models.EmailField(verbose_name=_("Contact email address"), blank=True,
help_text=_(
......@@ -245,11 +250,15 @@ class Room(models.Model):
ordering = ['building', 'name']
unique_together = [['name', 'building']]
def __str__(self):
@property
def title(self):
if self.building:
return f"{self.building} {self.name}"
return self.name
def __str__(self):
return self.title
class AKSlot(models.Model):
""" An AK Mapping matches an AK to a room during a certain time.
......
......@@ -45,6 +45,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles',
'bootstrap4',
'fontawesome',
'timezone_field',
]
MIDDLEWARE = [
......
......@@ -2,3 +2,4 @@ Django==2.2.6
django-bootstrap4==1.0.1
django-fontawesome==1.0
django-split-settings==1.0.0
django-timezone-field==4.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment