Browse Source

Add university, faculty and study fields als models.

V1
Joshua Rubingh 1 year ago
parent
commit
cf55aa378a
  1. 1
      VRE/VRE/settings.py
  2. 14
      VRE/apps/api/locale/en/LC_MESSAGES/django.po
  3. 14
      VRE/apps/api/locale/nl/LC_MESSAGES/django.po
  4. 2
      VRE/apps/api/migrations/0001_initial.py
  5. 3
      VRE/apps/api/urls.py
  6. 2
      VRE/apps/dropoff/locale/en/LC_MESSAGES/django.po
  7. 2
      VRE/apps/dropoff/locale/nl/LC_MESSAGES/django.po
  8. 2
      VRE/apps/dropoff/migrations/0001_initial.py
  9. 15
      VRE/apps/invitation/locale/en/LC_MESSAGES/django.po
  10. 15
      VRE/apps/invitation/locale/nl/LC_MESSAGES/django.po
  11. 2
      VRE/apps/invitation/migrations/0001_initial.py
  12. 4
      VRE/apps/openstack/migrations/0001_initial.py
  13. 12
      VRE/apps/researcher/locale/en/LC_MESSAGES/django.po
  14. 12
      VRE/apps/researcher/locale/nl/LC_MESSAGES/django.po
  15. 4
      VRE/apps/researcher/migrations/0001_initial.py
  16. 4
      VRE/apps/researcher/models.py
  17. 14
      VRE/apps/storage/locale/en/LC_MESSAGES/django.po
  18. 14
      VRE/apps/storage/locale/nl/LC_MESSAGES/django.po
  19. 4
      VRE/apps/storage/migrations/0001_initial.py
  20. 20
      VRE/apps/study/locale/en/LC_MESSAGES/django.po
  21. 20
      VRE/apps/study/locale/nl/LC_MESSAGES/django.po
  22. 2
      VRE/apps/study/migrations/0001_initial.py
  23. 1
      VRE/apps/university/__init__.py
  24. 24
      VRE/apps/university/admin.py
  25. 8
      VRE/apps/university/apps.py
  26. 525
      VRE/apps/university/fixtures/university_initial_data.json
  27. 88
      VRE/apps/university/locale/en/LC_MESSAGES/django.po
  28. 94
      VRE/apps/university/locale/nl/LC_MESSAGES/django.po
  29. 64
      VRE/apps/university/migrations/0001_initial.py
  30. 0
      VRE/apps/university/migrations/__init__.py
  31. 87
      VRE/apps/university/models.py
  32. 36
      VRE/apps/university/serializers.py
  33. 3
      VRE/apps/university/tests.py
  34. 9
      VRE/apps/university/urls.py
  35. 80
      VRE/apps/university/views.py
  36. 84
      VRE/apps/virtual_machine/locale/en/LC_MESSAGES/django.po
  37. 91
      VRE/apps/virtual_machine/locale/nl/LC_MESSAGES/django.po
  38. 2
      VRE/apps/virtual_machine/migrations/0001_initial.py
  39. 4
      VRE/apps/vrw/migrations/0001_initial.py
  40. 99
      VRE/locale/en/LC_MESSAGES/django.po
  41. 114
      VRE/locale/nl/LC_MESSAGES/django.po
  42. BIN
      doc/documentation.pdf
  43. 6
      doc/models.rst
  44. 3
      docker/entrypoint.api.sh

1
VRE/VRE/settings.py

@ -51,6 +51,7 @@ INSTALLED_APPS = [ @@ -51,6 +51,7 @@ INSTALLED_APPS = [
'apps.virtual_machine',
'apps.vrw',
'apps.openstack',
'apps.university',
'djoser',
'rest_framework',

14
VRE/apps/api/locale/en/LC_MESSAGES/django.po

@ -8,7 +8,7 @@ msgid "" @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-19 11:19+0100\n"
"POT-Creation-Date: 2021-04-29 12:05+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"
@ -18,11 +18,11 @@ msgstr "" @@ -18,11 +18,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: apps/api/apps.py:9
#: apps/api/apps.py:11
msgid "API"
msgstr ""
#: apps/api/apps.py:10
#: apps/api/apps.py:12
msgid "APIs"
msgstr ""
@ -65,3 +65,11 @@ msgstr "" @@ -65,3 +65,11 @@ msgstr ""
#: apps/api/models.py:64
msgid "Super token"
msgstr ""
#: apps/api/serializers.py:12
msgid "Your username to login"
msgstr ""
#: apps/api/serializers.py:13
msgid "Your password to login"
msgstr ""

14
VRE/apps/api/locale/nl/LC_MESSAGES/django.po

@ -7,7 +7,7 @@ msgid "" @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-19 11:19+0100\n"
"POT-Creation-Date: 2021-04-29 12:05+0000\n"
"PO-Revision-Date: 2020-05-27 16:25+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n"
@ -18,11 +18,11 @@ msgstr "" @@ -18,11 +18,11 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.6\n"
#: apps/api/apps.py:9
#: apps/api/apps.py:11
msgid "API"
msgstr "API"
#: apps/api/apps.py:10
#: apps/api/apps.py:12
msgid "APIs"
msgstr "APIs"
@ -65,3 +65,11 @@ msgstr "" @@ -65,3 +65,11 @@ msgstr ""
#: apps/api/models.py:64
msgid "Super token"
msgstr ""
#: apps/api/serializers.py:12
msgid "Your username to login"
msgstr ""
#: apps/api/serializers.py:13
msgid "Your password to login"
msgstr ""

2
VRE/apps/api/migrations/0001_initial.py

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# Generated by Django 3.1.7 on 2021-04-20 08:37
# Generated by Django 3.2 on 2021-04-29 12:02
import apps.api.models
from django.conf import settings

3
VRE/apps/api/urls.py

@ -57,6 +57,7 @@ api_router_v1.register(r'virtualmachines/gpu', VirtualMachineGPUViewSet) @@ -57,6 +57,7 @@ api_router_v1.register(r'virtualmachines/gpu', VirtualMachineGPUViewSet)
api_router_v1.register(r'virtualmachines/os', VirtualMachineOperatingSystemViewSet)
api_router_v1.register(r'virtualmachines', VirtualMachineViewSet)
api_router_v1.urls.append(path('universities/', include('apps.university.urls')))
api_router_v1.urls.append(path('vrw/', include('apps.vrw.urls')))
# Main namespace for the API urls
@ -70,7 +71,7 @@ urlpatterns = [ @@ -70,7 +71,7 @@ urlpatterns = [
path('auth/', include('djoser.urls')),
path('auth/', include('djoser.urls.jwt')),
# Custom login for getting the HAWK keys
path('auth/login/', views.Login.as_view(), name='api-login'),
path('auth/hawk/create/', views.Login.as_view(), name='api-login'),
# Extra /api/info path for checking if the Hawk authentication is working.
# Also this will give the full url to the OpenAPI documentation

2
VRE/apps/dropoff/locale/en/LC_MESSAGES/django.po

@ -8,7 +8,7 @@ msgid "" @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-19 11:19+0100\n"
"POT-Creation-Date: 2021-04-29 12:05+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"

2
VRE/apps/dropoff/locale/nl/LC_MESSAGES/django.po

@ -8,7 +8,7 @@ msgid "" @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-19 11:19+0100\n"
"POT-Creation-Date: 2021-04-29 12:05+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"

2
VRE/apps/dropoff/migrations/0001_initial.py

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# Generated by Django 3.1.7 on 2021-04-20 08:37
# Generated by Django 3.2 on 2021-04-29 12:02
from django.db import migrations, models
import django.db.models.deletion

15
VRE/apps/invitation/locale/en/LC_MESSAGES/django.po

@ -8,7 +8,7 @@ msgid "" @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-19 11:19+0100\n"
"POT-Creation-Date: 2021-04-29 12:05+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"
@ -85,3 +85,16 @@ msgstr "" @@ -85,3 +85,16 @@ msgstr ""
#: apps/invitation/models.py:49
msgid "The date when the last invitation is send."
msgstr ""
#: apps/invitation/views.py:35
msgid "Invitation does not exists"
msgstr ""
#: apps/invitation/views.py:40
msgid "Unknown error"
msgstr ""
#: apps/invitation/views.py:46
#, python-format
msgid "Invitation to %(name)s (%(email)s) is sent"
msgstr ""

15
VRE/apps/invitation/locale/nl/LC_MESSAGES/django.po

@ -7,7 +7,7 @@ msgid "" @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-19 11:19+0100\n"
"POT-Creation-Date: 2021-04-29 12:05+0000\n"
"PO-Revision-Date: 2020-05-27 16:25+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n"
@ -86,6 +86,19 @@ msgstr "" @@ -86,6 +86,19 @@ msgstr ""
msgid "The date when the last invitation is send."
msgstr ""
#: apps/invitation/views.py:35
msgid "Invitation does not exists"
msgstr ""
#: apps/invitation/views.py:40
msgid "Unknown error"
msgstr ""
#: apps/invitation/views.py:46
#, python-format
msgid "Invitation to %(name)s (%(email)s) is sent"
msgstr ""
#~ msgid "API"
#~ msgstr "API"

2
VRE/apps/invitation/migrations/0001_initial.py

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# Generated by Django 3.1.7 on 2021-04-20 08:37
# Generated by Django 3.2 on 2021-04-29 12:02
from django.db import migrations, models
import django.db.models.deletion

4
VRE/apps/openstack/migrations/0001_initial.py

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# Generated by Django 3.1.7 on 2021-04-20 08:37
# Generated by Django 3.2 on 2021-04-29 12:02
from django.db import migrations, models
import django.db.models.deletion
@ -9,8 +9,8 @@ class Migration(migrations.Migration): @@ -9,8 +9,8 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('virtual_machine', '0001_initial'),
('contenttypes', '0002_remove_content_type_name'),
]
operations = [

12
VRE/apps/researcher/locale/en/LC_MESSAGES/django.po

@ -8,7 +8,7 @@ msgid "" @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-19 11:19+0100\n"
"POT-Creation-Date: 2021-04-29 12:05+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"
@ -26,14 +26,18 @@ msgstr "" @@ -26,14 +26,18 @@ msgstr ""
msgid "Researchers"
msgstr ""
#: apps/researcher/models.py:29
#: apps/researcher/models.py:30
msgid "researcher"
msgstr ""
#: apps/researcher/models.py:30
#: apps/researcher/models.py:31
msgid "researchers"
msgstr ""
#: apps/researcher/models.py:33
#: apps/researcher/models.py:34
msgid "Select the user that has to become a researcher"
msgstr ""
#: apps/researcher/models.py:35
msgid "Select the faculty where this researcher belongs to"
msgstr ""

12
VRE/apps/researcher/locale/nl/LC_MESSAGES/django.po

@ -7,7 +7,7 @@ msgid "" @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-19 11:19+0100\n"
"POT-Creation-Date: 2021-04-29 12:05+0000\n"
"PO-Revision-Date: 2020-05-27 16:25+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n"
@ -26,18 +26,22 @@ msgstr "" @@ -26,18 +26,22 @@ msgstr ""
msgid "Researchers"
msgstr ""
#: apps/researcher/models.py:29
#: apps/researcher/models.py:30
msgid "researcher"
msgstr ""
#: apps/researcher/models.py:30
#: apps/researcher/models.py:31
msgid "researchers"
msgstr ""
#: apps/researcher/models.py:33
#: apps/researcher/models.py:34
msgid "Select the user that has to become a researcher"
msgstr ""
#: apps/researcher/models.py:35
msgid "Select the faculty where this researcher belongs to"
msgstr ""
#~ msgid "API"
#~ msgstr "API"

4
VRE/apps/researcher/migrations/0001_initial.py

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# Generated by Django 3.1.7 on 2021-04-20 08:37
# Generated by Django 3.2 on 2021-04-29 12:02
from django.conf import settings
from django.db import migrations, models
@ -10,6 +10,7 @@ class Migration(migrations.Migration): @@ -10,6 +10,7 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('university', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
@ -21,6 +22,7 @@ class Migration(migrations.Migration): @@ -21,6 +22,7 @@ class Migration(migrations.Migration):
('deleted', models.DateTimeField(editable=False, null=True)),
('created_at', models.DateTimeField(auto_now_add=True, help_text='The date and time this model has been created', verbose_name='Date created')),
('updated_at', models.DateTimeField(auto_now=True, help_text='The date and time this model has been updated', verbose_name='Date updated')),
('faculty', models.ForeignKey(help_text='Select the faculty where this researcher belongs to', on_delete=django.db.models.deletion.CASCADE, to='university.faculty')),
('user', models.OneToOneField(help_text='Select the user that has to become a researcher', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={

4
VRE/apps/researcher/models.py

@ -3,6 +3,7 @@ from django.contrib.auth.models import User @@ -3,6 +3,7 @@ from django.contrib.auth.models import User
from django.utils.translation import gettext_lazy as _
from lib.models.base import MetaDataModel
from apps.university.models import Faculty
# Create your models here.
class ResearcherManager(models.Manager):
@ -30,7 +31,8 @@ class Researcher(MetaDataModel): @@ -30,7 +31,8 @@ class Researcher(MetaDataModel):
verbose_name_plural = _('researchers')
ordering = ['user__last_name']
user = models.OneToOneField(User, on_delete=models.CASCADE, help_text=_('Select the user that has to become a researcher'))
user = models.OneToOneField(User, on_delete=models.CASCADE, help_text=_('Select the user that has to become a researcher'))
faculty = models.ForeignKey(Faculty, on_delete=models.CASCADE, help_text=_('Select the faculty where this researcher belongs to'))
# Custom manager that will retrieve the related user table as well.
objects = ResearcherManager()

14
VRE/apps/storage/locale/en/LC_MESSAGES/django.po

@ -8,7 +8,7 @@ msgid "" @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-19 11:19+0100\n"
"POT-Creation-Date: 2021-04-29 12:05+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"
@ -135,14 +135,22 @@ msgid "Folder to store the data. Will be created when does not exists." @@ -135,14 +135,22 @@ msgid "Folder to store the data. Will be created when does not exists."
msgstr ""
#: apps/storage/models.py:127
msgid "Encryption password"
msgid "Upload path"
msgstr ""
#: apps/storage/models.py:127
msgid "Folder where the raw uploads are saved."
msgstr ""
#: apps/storage/models.py:129
msgid "Encryption password"
msgstr ""
#: apps/storage/models.py:129
msgid ""
"Password for encryption the uploaded data. Leave empty to disable encryption."
msgstr ""
#: apps/storage/models.py:137
#: apps/storage/models.py:141
msgid "Encrypted"
msgstr ""

14
VRE/apps/storage/locale/nl/LC_MESSAGES/django.po

@ -7,7 +7,7 @@ msgid "" @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-19 11:19+0100\n"
"POT-Creation-Date: 2021-04-29 12:05+0000\n"
"PO-Revision-Date: 2020-05-27 16:25+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n"
@ -135,15 +135,23 @@ msgid "Folder to store the data. Will be created when does not exists." @@ -135,15 +135,23 @@ msgid "Folder to store the data. Will be created when does not exists."
msgstr ""
#: apps/storage/models.py:127
msgid "Encryption password"
msgid "Upload path"
msgstr ""
#: apps/storage/models.py:127
msgid "Folder where the raw uploads are saved."
msgstr ""
#: apps/storage/models.py:129
msgid "Encryption password"
msgstr ""
#: apps/storage/models.py:129
msgid ""
"Password for encryption the uploaded data. Leave empty to disable encryption."
msgstr ""
#: apps/storage/models.py:137
#: apps/storage/models.py:141
msgid "Encrypted"
msgstr ""

4
VRE/apps/storage/migrations/0001_initial.py

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# Generated by Django 3.1.7 on 2021-04-20 08:37
# Generated by Django 3.2 on 2021-04-29 12:02
from django.db import migrations, models
import django.db.models.deletion
@ -11,8 +11,8 @@ class Migration(migrations.Migration): @@ -11,8 +11,8 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('researcher', '0001_initial'),
('study', '0001_initial'),
('researcher', '0001_initial'),
]
operations = [

20
VRE/apps/study/locale/en/LC_MESSAGES/django.po

@ -8,7 +8,7 @@ msgid "" @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-19 11:19+0100\n"
"POT-Creation-Date: 2021-04-29 12:05+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"
@ -34,38 +34,38 @@ msgstr "" @@ -34,38 +34,38 @@ msgstr ""
msgid "studies"
msgstr ""
#: apps/study/models.py:63
#: apps/study/models.py:64
msgid "Choose the researcher which owns this study"
msgstr ""
#: apps/study/models.py:64
#: apps/study/models.py:65
msgid "Name"
msgstr ""
#: apps/study/models.py:64
#: apps/study/models.py:65
msgid "Name of the research study."
msgstr ""
#: apps/study/models.py:65
#: apps/study/models.py:66
msgid "Description"
msgstr ""
#: apps/study/models.py:65
#: apps/study/models.py:66
msgid "Enter a short description for this study."
msgstr ""
#: apps/study/models.py:67
#: apps/study/models.py:68
msgid "Upload code"
msgstr ""
#: apps/study/models.py:67
#: apps/study/models.py:68
msgid "A unique upload code. Will be generated when a new study is saved."
msgstr ""
#: apps/study/models.py:68
#: apps/study/models.py:69
msgid "Upload url key"
msgstr ""
#: apps/study/models.py:68
#: apps/study/models.py:69
msgid "A unique upload url. Will be generated when a new study is saved."
msgstr ""

20
VRE/apps/study/locale/nl/LC_MESSAGES/django.po

@ -7,7 +7,7 @@ msgid "" @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-19 11:19+0100\n"
"POT-Creation-Date: 2021-04-29 12:05+0000\n"
"PO-Revision-Date: 2020-05-27 16:25+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n"
@ -34,39 +34,39 @@ msgstr "" @@ -34,39 +34,39 @@ msgstr ""
msgid "studies"
msgstr ""
#: apps/study/models.py:63
#: apps/study/models.py:64
msgid "Choose the researcher which owns this study"
msgstr ""
#: apps/study/models.py:64
#: apps/study/models.py:65
msgid "Name"
msgstr ""
#: apps/study/models.py:64
#: apps/study/models.py:65
msgid "Name of the research study."
msgstr ""
#: apps/study/models.py:65
#: apps/study/models.py:66
msgid "Description"
msgstr ""
#: apps/study/models.py:65
#: apps/study/models.py:66
msgid "Enter a short description for this study."
msgstr ""
#: apps/study/models.py:67
#: apps/study/models.py:68
msgid "Upload code"
msgstr ""
#: apps/study/models.py:67
#: apps/study/models.py:68
msgid "A unique upload code. Will be generated when a new study is saved."
msgstr ""
#: apps/study/models.py:68
#: apps/study/models.py:69
msgid "Upload url key"
msgstr ""
#: apps/study/models.py:68
#: apps/study/models.py:69
msgid "A unique upload url. Will be generated when a new study is saved."
msgstr ""

2
VRE/apps/study/migrations/0001_initial.py

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# Generated by Django 3.1.7 on 2021-04-20 08:37
# Generated by Django 3.2 on 2021-04-29 12:02
from django.db import migrations, models
import django.db.models.deletion

1
VRE/apps/university/__init__.py

@ -0,0 +1 @@ @@ -0,0 +1 @@
default_app_config = 'apps.university.apps.UniversityConfig'

24
VRE/apps/university/admin.py

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
from django.contrib import admin
from safedelete.admin import SafeDeleteAdmin
from .models import University, Faculty, StudyField
@admin.register(University)
class UniversityAdmin(SafeDeleteAdmin):
list_display = ('name', 'email', 'created_at') + SafeDeleteAdmin.list_display
ordering = ('-created_at', 'name', 'email', )
search_fields = ('name', 'email')
readonly_fields = ('created_at', 'updated_at')
@admin.register(Faculty)
class FacultyAdmin(SafeDeleteAdmin):
list_display = ('name', 'university', 'created_at') + SafeDeleteAdmin.list_display
ordering = ('-created_at', 'name', 'university', )
search_fields = ('name', 'university')
readonly_fields = ('created_at', 'updated_at')
@admin.register(StudyField)
class StudyFieldAdmin(SafeDeleteAdmin):
list_display = ('name', 'created_at') + SafeDeleteAdmin.list_display
ordering = ('-created_at', 'name')
search_fields = ('name', )
readonly_fields = ('created_at', 'updated_at')

8
VRE/apps/university/apps.py

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class UniversityConfig(AppConfig):
name = 'apps.university'
label = 'university'
verbose_name = _('University')
verbose_name_plural = _('Universities')

525
VRE/apps/university/fixtures/university_initial_data.json

@ -0,0 +1,525 @@ @@ -0,0 +1,525 @@
[
{
"model": "university.university",
"pk": 1,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:36:00.735Z",
"updated_at": "2021-04-29T09:52:14.242Z",
"name": "Rijksuniversiteit Groningen",
"email": "info@rug.nl",
"website": "https://www.rug.nl"
}
},
{
"model": "university.studyfield",
"pk": 1,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:52:25.722Z",
"updated_at": "2021-04-29T09:52:25.722Z",
"name": "Climate & Energy Transitions"
}
},
{
"model": "university.studyfield",
"pk": 2,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:52:35.750Z",
"updated_at": "2021-04-29T09:52:35.750Z",
"name": "Population & Well-being"
}
},
{
"model": "university.studyfield",
"pk": 3,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:52:41.491Z",
"updated_at": "2021-04-29T09:52:41.491Z",
"name": "Quality of Life and Happiness"
}
},
{
"model": "university.studyfield",
"pk": 4,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:52:50.375Z",
"updated_at": "2021-04-29T09:52:50.375Z",
"name": "Real Estate & Housing"
}
},
{
"model": "university.studyfield",
"pk": 5,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:52:56.276Z",
"updated_at": "2021-04-29T09:52:56.277Z",
"name": "Sustainability & Regional Development"
}
},
{
"model": "university.studyfield",
"pk": 6,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:53:01.500Z",
"updated_at": "2021-04-29T09:53:01.500Z",
"name": "Governance & Civic Initiatives"
}
},
{
"model": "university.studyfield",
"pk": 7,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:56:05.543Z",
"updated_at": "2021-04-29T09:56:05.543Z",
"name": "Liveable and Resilient Communities"
}
},
{
"model": "university.studyfield",
"pk": 8,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:56:11.050Z",
"updated_at": "2021-04-29T09:56:11.050Z",
"name": "Tourism & Heritage"
}
},
{
"model": "university.studyfield",
"pk": 9,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:56:16.462Z",
"updated_at": "2021-04-29T09:56:16.462Z",
"name": "Spatial & Institutional Design"
}
},
{
"model": "university.studyfield",
"pk": 10,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:56:22.053Z",
"updated_at": "2021-04-29T09:56:22.053Z",
"name": "Landscape Perceptions"
}
},
{
"model": "university.studyfield",
"pk": 11,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:56:28.057Z",
"updated_at": "2021-04-29T09:56:28.057Z",
"name": "Infrastructure & Transport"
}
},
{
"model": "university.studyfield",
"pk": 12,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:56:34.030Z",
"updated_at": "2021-04-29T09:56:34.031Z",
"name": "Migration & Mobility"
}
},
{
"model": "university.studyfield",
"pk": 13,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:56:40.078Z",
"updated_at": "2021-04-29T09:56:40.078Z",
"name": "Environmental & Social Impact Assessment"
}
},
{
"model": "university.studyfield",
"pk": 14,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:56:45.697Z",
"updated_at": "2021-04-29T09:56:45.697Z",
"name": "Entrepreneurship"
}
},
{
"model": "university.studyfield",
"pk": 15,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:56:53.270Z",
"updated_at": "2021-04-29T09:56:53.270Z",
"name": "Regional Labour Markets"
}
},
{
"model": "university.studyfield",
"pk": 16,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:56:59.322Z",
"updated_at": "2021-04-29T09:56:59.322Z",
"name": "Socio-economic and health inequalities"
}
},
{
"model": "university.studyfield",
"pk": 17,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:57:07.128Z",
"updated_at": "2021-04-29T09:57:07.128Z",
"name": "Coastal Resilience"
}
},
{
"model": "university.studyfield",
"pk": 18,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:58:20.510Z",
"updated_at": "2021-04-29T09:58:20.510Z",
"name": "Understandig societal change"
}
},
{
"model": "university.studyfield",
"pk": 19,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:58:27.146Z",
"updated_at": "2021-04-29T09:58:27.146Z",
"name": "Deficits, distress and disorders"
}
},
{
"model": "university.studyfield",
"pk": 20,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:58:38.505Z",
"updated_at": "2021-04-29T09:58:38.505Z",
"name": "Lifespan development and socialization"
}
},
{
"model": "university.studyfield",
"pk": 21,
"fields": {
"deleted": null,
"created_at": "2021-04-29T10:03:35.592Z",
"updated_at": "2021-04-29T10:03:35.592Z",
"name": "Effective Criminal Law"
}
},
{
"model": "university.studyfield",
"pk": 22,
"fields": {
"deleted": null,
"created_at": "2021-04-29T10:03:44.191Z",
"updated_at": "2021-04-29T10:03:44.191Z",
"name": "Law on Energy and Sustainability"
}
},
{
"model": "university.studyfield",
"pk": 23,
"fields": {
"deleted": null,
"created_at": "2021-04-29T10:03:52.381Z",
"updated_at": "2021-04-29T10:03:52.381Z",
"name": "Protecting European Citizens and Market Participants"
}
},
{
"model": "university.studyfield",
"pk": 24,
"fields": {
"deleted": null,
"created_at": "2021-04-29T10:04:03.467Z",
"updated_at": "2021-04-29T10:04:03.468Z",
"name": "Public Interests and Private Relationships"
}
},
{
"model": "university.studyfield",
"pk": 25,
"fields": {
"deleted": null,
"created_at": "2021-04-29T10:04:11.211Z",
"updated_at": "2021-04-29T10:04:11.211Z",
"name": "Public Trust and Public Law"
}
},
{
"model": "university.studyfield",
"pk": 26,
"fields": {
"deleted": null,
"created_at": "2021-04-29T10:04:19.423Z",
"updated_at": "2021-04-29T10:04:19.424Z",
"name": "User-friendly Private Law"
}
},
{
"model": "university.studyfield",
"pk": 27,
"fields": {
"deleted": null,
"created_at": "2021-04-29T10:04:25.917Z",
"updated_at": "2021-04-29T10:04:25.918Z",
"name": "Transboundary Legal Studies"
}
},
{
"model": "university.studyfield",
"pk": 28,
"fields": {
"deleted": null,
"created_at": "2021-04-29T10:05:18.656Z",
"updated_at": "2021-04-29T10:05:18.656Z",
"name": "Advanced Materials"
}
},
{
"model": "university.studyfield",
"pk": 29,
"fields": {
"deleted": null,
"created_at": "2021-04-29T10:05:25.139Z",
"updated_at": "2021-04-29T10:05:25.140Z",
"name": "Molecular Life and Health"
}
},
{
"model": "university.studyfield",
"pk": 30,
"fields": {
"deleted": null,
"created_at": "2021-04-29T10:05:31.161Z",
"updated_at": "2021-04-29T10:05:31.161Z",
"name": "Adaptive Life"
}
},
{
"model": "university.studyfield",
"pk": 31,
"fields": {
"deleted": null,
"created_at": "2021-04-29T10:05:37.997Z",
"updated_at": "2021-04-29T10:05:37.997Z",
"name": "Data Science and Systems Complexity"
}
},
{
"model": "university.studyfield",
"pk": 32,
"fields": {
"deleted": null,
"created_at": "2021-04-29T10:06:34.314Z",
"updated_at": "2021-04-29T10:06:34.314Z",
"name": "Ethiek, Sociale en Politieke Filosofie"
}
},
{
"model": "university.studyfield",
"pk": 33,
"fields": {
"deleted": null,
"created_at": "2021-04-29T10:06:41.422Z",
"updated_at": "2021-04-29T10:06:41.422Z",
"name": "Geschiedenis van de Filosofie"
}
},
{
"model": "university.studyfield",
"pk": 34,
"fields": {
"deleted": null,
"created_at": "2021-04-29T10:06:47.649Z",
"updated_at": "2021-04-29T10:06:47.649Z",
"name": "Theoretische Filosofie"
}
},
{
"model": "university.faculty",
"pk": 2,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:40:00.843Z",
"updated_at": "2021-04-29T09:40:00.843Z",
"name": "Economie en Bedrijfskunde",
"university": 1,
"study_fields": []
}
},
{
"model": "university.faculty",
"pk": 3,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:40:15.232Z",
"updated_at": "2021-04-29T09:59:05.168Z",
"name": "Gedrags- en Maatschappij-wetenschappen",
"university": 1,
"study_fields": [
19,
20,
18
]
}
},
{
"model": "university.faculty",
"pk": 4,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:40:26.287Z",
"updated_at": "2021-04-29T09:40:26.287Z",
"name": "Godgeleerdheid en Godsdienst- wetenschap",
"university": 1,
"study_fields": []
}
},
{
"model": "university.faculty",
"pk": 5,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:40:34.920Z",
"updated_at": "2021-04-29T09:40:34.920Z",
"name": "Letteren",
"university": 1,
"study_fields": []
}
},
{
"model": "university.faculty",
"pk": 6,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:40:43.131Z",
"updated_at": "2021-04-29T09:40:43.131Z",
"name": "Medische Wetenschappen",
"university": 1,
"study_fields": []
}
},
{
"model": "university.faculty",
"pk": 7,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:40:51.248Z",
"updated_at": "2021-04-29T10:04:42.753Z",
"name": "Rechtsgeleerdheid",
"university": 1,
"study_fields": [
21,
22,
23,
24,
25,
27,
26
]
}
},
{
"model": "university.faculty",
"pk": 8,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:41:00.072Z",
"updated_at": "2021-04-29T09:57:18.767Z",
"name": "Ruimtelijke Wetenschappen",
"university": 1,
"study_fields": [
1,
17,
14,
13,
6,
11,
10,
7,
12,
2,
3,
4,
15,
16,
9,
5,
8
]
}
},
{
"model": "university.faculty",
"pk": 9,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:41:10.777Z",
"updated_at": "2021-04-29T10:05:55.983Z",
"name": "Science and Engineering",
"university": 1,
"study_fields": [
30,
28,
31,
29
]
}
},
{
"model": "university.faculty",
"pk": 10,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:41:17.643Z",
"updated_at": "2021-04-29T10:07:00.916Z",
"name": "Wijsbegeerte",
"university": 1,
"study_fields": [
32,
33,
34
]
}
},
{
"model": "university.faculty",
"pk": 11,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:41:24.270Z",
"updated_at": "2021-04-29T09:41:24.270Z",
"name": "University College Groningen",
"university": 1,
"study_fields": []
}
},
{
"model": "university.faculty",
"pk": 12,
"fields": {
"deleted": null,
"created_at": "2021-04-29T09:41:32.065Z",
"updated_at": "2021-04-29T09:41:32.066Z",
"name": "Rijksuniversiteit Groningen/Campus Fryslân",
"university": 1,
"study_fields": []
}
}
]

88
VRE/apps/university/locale/en/LC_MESSAGES/django.po

@ -0,0 +1,88 @@ @@ -0,0 +1,88 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-04-29 12:05+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"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: apps/university/apps.py:7
msgid "University"
msgstr ""
#: apps/university/apps.py:8
msgid "Universities"
msgstr ""
#: apps/university/models.py:24
msgid "university"
msgstr ""
#: apps/university/models.py:25
msgid "universities"
msgstr ""
#: apps/university/models.py:28 apps/university/models.py:53
#: apps/university/models.py:80
msgid "Name"
msgstr ""
#: apps/university/models.py:28
msgid "The name of the university."
msgstr ""
#: apps/university/models.py:29
msgid "Email address"
msgstr ""
#: apps/university/models.py:29
msgid "The general email address for this university."
msgstr ""
#: apps/university/models.py:30
msgid "Website"
msgstr ""
#: apps/university/models.py:30
msgid "The full url to this university website."
msgstr ""
#: apps/university/models.py:49
msgid "study field"
msgstr ""
#: apps/university/models.py:50
msgid "study fields"
msgstr ""
#: apps/university/models.py:53
msgid "The name of the study field."
msgstr ""
#: apps/university/models.py:76
msgid "faculty"
msgstr ""
#: apps/university/models.py:77
msgid "faculties"
msgstr ""
#: apps/university/models.py:80
msgid "The name of the faculty."
msgstr ""
#: apps/university/models.py:81
msgid "To wich university belongs this faculty"
msgstr ""

94
VRE/apps/university/locale/nl/LC_MESSAGES/django.po

@ -0,0 +1,94 @@ @@ -0,0 +1,94 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-04-29 12:05+0000\n"
"PO-Revision-Date: 2020-05-27 16:25+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.6\n"
#: apps/university/apps.py:7
msgid "University"
msgstr ""
#: apps/university/apps.py:8
msgid "Universities"
msgstr ""
#: apps/university/models.py:24
msgid "university"
msgstr ""
#: apps/university/models.py:25
msgid "universities"
msgstr ""
#: apps/university/models.py:28 apps/university/models.py:53
#: apps/university/models.py:80
msgid "Name"
msgstr ""
#: apps/university/models.py:28
msgid "The name of the university."
msgstr ""
#: apps/university/models.py:29
msgid "Email address"
msgstr ""
#: apps/university/models.py:29
msgid "The general email address for this university."
msgstr ""
#: apps/university/models.py:30
msgid "Website"
msgstr ""
#: apps/university/models.py:30
msgid "The full url to this university website."
msgstr ""
#: apps/university/models.py:49
msgid "study field"
msgstr ""
#: apps/university/models.py:50
msgid "study fields"
msgstr ""
#: apps/university/models.py:53
msgid "The name of the study field."
msgstr ""
#: apps/university/models.py:76
msgid "faculty"
msgstr ""
#: apps/university/models.py:77
msgid "faculties"
msgstr ""
#: apps/university/models.py:80
msgid "The name of the faculty."
msgstr ""
#: apps/university/models.py:81
msgid "To wich university belongs this faculty"
msgstr ""
#~ msgid "API"
#~ msgstr "API"
#~ msgid "APIs"
#~ msgstr "APIs"

64
VRE/apps/university/migrations/0001_initial.py

@ -0,0 +1,64 @@ @@ -0,0 +1,64 @@
# Generated by Django 3.2 on 2021-04-29 12:02
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='StudyField',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('deleted', models.DateTimeField(editable=False, null=True)),
('created_at', models.DateTimeField(auto_now_add=True, help_text='The date and time this model has been created', verbose_name='Date created')),
('updated_at', models.DateTimeField(auto_now=True, help_text='The date and time this model has been updated', verbose_name='Date updated')),
('name', models.CharField(help_text='The name of the study field.', max_length=200, verbose_name='Name')),
],
options={
'verbose_name': 'study field',
'verbose_name_plural': 'study fields',
'ordering': ['name'],
},
),
migrations.CreateModel(
name='University',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('deleted', models.DateTimeField(editable=False, null=True)),
('created_at', models.DateTimeField(auto_now_add=True, help_text='The date and time this model has been created', verbose_name='Date created')),
('updated_at', models.DateTimeField(auto_now=True, help_text='The date and time this model has been updated', verbose_name='Date updated')),
('name', models.CharField(help_text='The name of the university.', max_length=200, verbose_name='Name')),
('email', models.EmailField(help_text='The general email address for this university.', max_length=200, verbose_name='Email address')),
('website', models.CharField(help_text='The full url to this university website.', max_length=200, verbose_name='Website')),
],
options={
'verbose_name': 'university',
'verbose_name_plural': 'universities',
'ordering': ['name'],
},
),
migrations.CreateModel(
name='Faculty',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('deleted', models.DateTimeField(editable=False, null=True)),
('created_at', models.DateTimeField(auto_now_add=True, help_text='The date and time this model has been created', verbose_name='Date created')),
('updated_at', models.DateTimeField(auto_now=True, help_text='The date and time this model has been updated', verbose_name='Date updated')),
('name', models.CharField(help_text='The name of the faculty.', max_length=200, verbose_name='Name')),
('study_fields', models.ManyToManyField(to='university.StudyField', verbose_name='study field')),
('university', models.ForeignKey(help_text='To wich university belongs this faculty', on_delete=django.db.models.deletion.CASCADE, to='university.university', verbose_name='university')),
],
options={
'verbose_name': 'faculty',
'verbose_name_plural': 'faculties',
'ordering': ['name'],
},
),
]

0
VRE/apps/university/migrations/__init__.py

87
VRE/apps/university/models.py