This commit is contained in:
mipel
2021-07-01 13:36:07 +02:00
commit c14e9466fb
91 changed files with 22395 additions and 0 deletions

0
organisation/__init__.py Normal file
View File

15
organisation/admin.py Normal file
View File

@@ -0,0 +1,15 @@
from django.contrib import admin
from organisation.models import Organisation
class OrganisationAdmin(admin.ModelAdmin):
list_display = [
"name",
"type",
"created_on",
"created_by",
]
admin.site.register(Organisation, OrganisationAdmin)

5
organisation/apps.py Normal file
View File

@@ -0,0 +1,5 @@
from django.apps import AppConfig
class OrganisationConfig(AppConfig):
name = 'organisation'

26
organisation/enums.py Normal file
View File

@@ -0,0 +1,26 @@
"""
Author: Michel Peltriaux
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
Contact: michel.peltriaux@sgdnord.rlp.de
Created on: 07.12.20
"""
from konova.enums import BaseEnum
class RoleTypeEnum(BaseEnum):
"""
Defines the possible role types for organisation and users
"""
DATAPROVIDER = "DATAPROVIDER"
LICENSINGAUTHORITY = "LICENSINGAUTHORITY"
REGISTRATIONOFFICE = "REGISTRATIONOFFICE"
class OrganisationTypeEnum(BaseEnum):
"""
Defines the possible role types for organisation and users
"""
OFFICIAL = "OFFICIAL"
COMPANY = "COMPANY"
NGO = "NGO"

18
organisation/models.py Normal file
View File

@@ -0,0 +1,18 @@
from django.db import models
from konova.models import BaseResource
from organisation.enums import OrganisationTypeEnum
class Organisation(BaseResource):
name = models.CharField(max_length=500, unique=True)
address = models.CharField(max_length=500, null=True, blank=True)
city = models.CharField(max_length=500, null=True, blank=True)
postal_code = models.CharField(max_length=100, null=True, blank=True)
phone = models.CharField(max_length=500, null=True, blank=True)
email = models.EmailField(max_length=500, null=True, blank=True)
facsimile = models.CharField(max_length=500, null=True, blank=True)
type = models.CharField(max_length=255, choices=OrganisationTypeEnum.as_choices(drop_empty_choice=True), null=True, blank=True)
def __str__(self):
return self.name

22
organisation/settings.py Normal file
View File

@@ -0,0 +1,22 @@
"""
Author: Michel Peltriaux
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
Contact: michel.peltriaux@sgdnord.rlp.de
Created on: 07.12.20
"""
from django.utils.translation import gettext_lazy as _
from organisation.enums import OrganisationTypeEnum as ote
from organisation.enums import RoleTypeEnum as rte
ORGANISATION_ROLE_STRINGS = {
ote.OFFICIAL.value: _("Official"),
ote.COMPANY.value: _("Company"),
ote.NGO.value: _("NGO"),
}
ROLE_TYPE_STRINGS = {
rte.DATAPROVIDER.value: _("Data provider"),
rte.LICENSINGAUTHORITY.value: _("Licencing Authority"),
rte.REGISTRATIONOFFICE.value: _("Registration office"),
}

3
organisation/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

12
organisation/urls.py Normal file
View File

@@ -0,0 +1,12 @@
"""
Author: Michel Peltriaux
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
Contact: michel.peltriaux@sgdnord.rlp.de
Created on: 07.12.20
"""
from django.urls import path
app_name = "organisation"
urlpatterns = [
]

3
organisation/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.