diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a4343b8..4324b8b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -22,6 +22,9 @@ default:
before_script:
- apt -y update
- apt -y install apt-utils -yqq
+ - echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
+ - DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y --no-install-recommends install tzdata
+ - cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime
- apt -y install net-tools python3.8 python3-pip mysql-client libmysqlclient-dev pkg-config -yqq
- apt -y upgrade
- pip3 install -r requirements.txt
@@ -41,5 +44,23 @@ django-tests:
# The MYSQL user only gets permissions for MYSQL_DB, so Django can't create a test database.
- echo "GRANT ALL on *.* to '${MYSQL_USER}';"| mysql -u root --password="${MYSQL_ROOT_PASSWORD}" -h mysql
# use python3 explicitly. see https://wiki.ubuntu.com/Python/3
- - python3 manage.py test --database=test
+ - python3 manage.py test
+qodana:
+ stage: test
+ inherit:
+ default: false
+ image:
+ name: jetbrains/qodana-python:2023.3-eap
+ entrypoint: [""]
+ variables:
+ QODANA_REMOTE_URL: git@$CI_SERVER_HOST:$CI_PROJECT_PATH.git
+ QODANA_BRANCH: $CI_COMMIT_BRANCH
+ QODANA_REPO_URL: $CI_PROJECT_URL
+ QODANA_JOB_URL: $CI_JOB_URL
+ script:
+ - qodana --save-report --results-dir=$CI_PROJECT_DIR/qodana --report-dir=$CI_PROJECT_DIR/qodana/report
+ artifacts:
+ paths:
+ - qodana/report/
+ expose_as: 'Qodana report'
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..13566b8
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..105ce2d
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..5396ca5
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..eefee65
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/quoteMe.iml b/.idea/quoteMe.iml
new file mode 100644
index 0000000..0214946
--- /dev/null
+++ b/.idea/quoteMe.iml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/quoteMe/settings.py b/quoteMe/settings.py
index c6719e7..d605a5d 100644
--- a/quoteMe/settings.py
+++ b/quoteMe/settings.py
@@ -38,6 +38,8 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
+ 'bootstrap5',
+ 'sourcePerson'
]
MIDDLEWARE = [
diff --git a/quoteMe/urls.py b/quoteMe/urls.py
index 9c7a8ba..aeedc79 100644
--- a/quoteMe/urls.py
+++ b/quoteMe/urls.py
@@ -14,8 +14,10 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
-from django.urls import path
+from django.urls import path, include
+from sourcePerson import urls
urlpatterns = [
path('admin/', admin.site.urls),
+ path('person/', include('sourcePerson.urls'))
]
diff --git a/requirements.txt b/requirements.txt
index 8b53a49..5b1b146 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,6 @@
asgiref==3.7.2
Django==4.2.7
+djangorestframework==3.14.0
mysqlclient==2.2.0
+pytz==2023.3.post1
sqlparse==0.4.4
diff --git a/sourcePerson/__init__.py b/sourcePerson/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/sourcePerson/admin.py b/sourcePerson/admin.py
new file mode 100644
index 0000000..f5b3ac1
--- /dev/null
+++ b/sourcePerson/admin.py
@@ -0,0 +1,4 @@
+from django.contrib import admin
+from .models import sourcePerson
+# Register your models here.
+admin.site.register(sourcePerson)
diff --git a/sourcePerson/apps.py b/sourcePerson/apps.py
new file mode 100644
index 0000000..a981cfe
--- /dev/null
+++ b/sourcePerson/apps.py
@@ -0,0 +1,6 @@
+from django.apps import AppConfig
+
+
+class SourcepersonConfig(AppConfig):
+ default_auto_field = 'django.db.models.BigAutoField'
+ name = 'sourcePerson'
diff --git a/sourcePerson/migrations/0001_initial.py b/sourcePerson/migrations/0001_initial.py
new file mode 100644
index 0000000..6bce57b
--- /dev/null
+++ b/sourcePerson/migrations/0001_initial.py
@@ -0,0 +1,25 @@
+# Generated by Django 3.2.18 on 2023-11-29 17:26
+
+from django.db import migrations, models
+import uuid
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='sourcePerson',
+ fields=[
+ ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
+ ('name', models.CharField(max_length=200)),
+ ('isActive', models.BooleanField(default=True)),
+ ('isArchived', models.BooleanField(default=False)),
+ ('description', models.TextField()),
+ ],
+ ),
+ ]
diff --git a/sourcePerson/migrations/0002_auto_20231129_1829.py b/sourcePerson/migrations/0002_auto_20231129_1829.py
new file mode 100644
index 0000000..e84d26c
--- /dev/null
+++ b/sourcePerson/migrations/0002_auto_20231129_1829.py
@@ -0,0 +1,25 @@
+# Generated by Django 3.2.18 on 2023-11-29 17:29
+
+import datetime
+from django.db import migrations, models
+from django.utils.timezone import utc
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('sourcePerson', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='sourceperson',
+ name='created_at',
+ field=models.DateTimeField(default=datetime.datetime(2023, 11, 29, 17, 29, 16, 298686, tzinfo=utc)),
+ ),
+ migrations.AddField(
+ model_name='sourceperson',
+ name='updated_at',
+ field=models.DateTimeField(default=datetime.datetime(2023, 11, 29, 17, 29, 16, 298700, tzinfo=utc)),
+ ),
+ ]
diff --git a/sourcePerson/migrations/0003_alter_sourceperson_created_at_and_more.py b/sourcePerson/migrations/0003_alter_sourceperson_created_at_and_more.py
new file mode 100644
index 0000000..f461256
--- /dev/null
+++ b/sourcePerson/migrations/0003_alter_sourceperson_created_at_and_more.py
@@ -0,0 +1,24 @@
+# Generated by Django 4.2.7 on 2023-12-19 16:48
+
+import datetime
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('sourcePerson', '0002_auto_20231129_1829'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='sourceperson',
+ name='created_at',
+ field=models.DateTimeField(default=datetime.datetime(2023, 12, 19, 16, 48, 48, 328450, tzinfo=datetime.timezone.utc)),
+ ),
+ migrations.AlterField(
+ model_name='sourceperson',
+ name='updated_at',
+ field=models.DateTimeField(default=datetime.datetime(2023, 12, 19, 16, 48, 48, 328467, tzinfo=datetime.timezone.utc)),
+ ),
+ ]
diff --git a/sourcePerson/migrations/__init__.py b/sourcePerson/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/sourcePerson/models.py b/sourcePerson/models.py
new file mode 100644
index 0000000..bb4852b
--- /dev/null
+++ b/sourcePerson/models.py
@@ -0,0 +1,13 @@
+from django.db import models
+from django.utils import timezone
+import uuid
+# Create your models here.
+
+class sourcePerson(models.Model):
+ id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
+ name = models.CharField(max_length=200)
+ isActive = models.BooleanField(default=True)
+ isArchived = models.BooleanField(default=False)
+ description = models.TextField()
+ created_at = models.DateTimeField(default=timezone.now())
+ updated_at = models.DateTimeField(default=timezone.now())
\ No newline at end of file
diff --git a/sourcePerson/serializers.py b/sourcePerson/serializers.py
new file mode 100644
index 0000000..3c78e79
--- /dev/null
+++ b/sourcePerson/serializers.py
@@ -0,0 +1,7 @@
+from rest_framework import serializers
+from .models import sourcePerson
+
+class sourcePersonSerializer(serializers.ModelSerializer):
+ class Meta:
+ model = sourcePerson
+ fields = ["id", "name", "description", "isActive", "isArchived", "created_at", "updated_at"]
\ No newline at end of file
diff --git a/sourcePerson/templates/create.html b/sourcePerson/templates/create.html
new file mode 100644
index 0000000..542b7ca
--- /dev/null
+++ b/sourcePerson/templates/create.html
@@ -0,0 +1,3 @@
+{% extends "header.html" %}
+
+{% block title %}Person anlegen{% endblock %}
\ No newline at end of file
diff --git a/sourcePerson/templates/header.html b/sourcePerson/templates/header.html
new file mode 100644
index 0000000..035b8ef
--- /dev/null
+++ b/sourcePerson/templates/header.html
@@ -0,0 +1,31 @@
+{% load bootstrap5 %}
+{% bootstrap_css %}
+{% bootstrap_javascript %}
+
+
+
+
+
+ {% block title %} Quote Me {% endblock %}
+
+
+
+
+ {% block content %}{% endblock %}
+
+
+
\ No newline at end of file
diff --git a/sourcePerson/templates/list.html b/sourcePerson/templates/list.html
new file mode 100644
index 0000000..02096ed
--- /dev/null
+++ b/sourcePerson/templates/list.html
@@ -0,0 +1,28 @@
+{% extends "header.html" %}
+
+{% block title %}Personlist{% endblock %}
+
+{% block content %}
+{% if persons %}
+
+
+
+ | Name |
+ Beschreibung |
+ Aktiviert |
+
+
+
+ {% for person in persons %}
+
+ | {{ person.name }} |
+ {{ person.description }} |
+ {{ person.isActive}} |
+
+ {% endfor %}
+
+
+ {%else%}
+ Nothing found
+ {%endif%}
+{% endblock %}
\ No newline at end of file
diff --git a/sourcePerson/tests.py b/sourcePerson/tests.py
new file mode 100644
index 0000000..7ce503c
--- /dev/null
+++ b/sourcePerson/tests.py
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/sourcePerson/urls.py b/sourcePerson/urls.py
new file mode 100644
index 0000000..eb12097
--- /dev/null
+++ b/sourcePerson/urls.py
@@ -0,0 +1,9 @@
+from django.urls import path
+from django.views.generic.base import TemplateView
+from . import views
+from . import models
+
+urlpatterns = [
+ path("create", TemplateView.as_view(template_name="create.html"), name="create"),
+ path("list", views.listPersons, name="list")
+]
\ No newline at end of file
diff --git a/sourcePerson/views.py b/sourcePerson/views.py
new file mode 100644
index 0000000..b86974e
--- /dev/null
+++ b/sourcePerson/views.py
@@ -0,0 +1,14 @@
+from rest_framework.decorators import api_view, permission_classes
+from django.shortcuts import render
+from django.http import JsonResponse
+from django.views.decorators.csrf import csrf_exempt
+from django.views.generic.base import TemplateView
+from . import models
+
+def listPersons(request, **kwargs):
+ persons = models.sourcePerson.objects.all()
+ data = {
+ "persons": persons
+ }
+
+ return render(request, 'list.html', data)
\ No newline at end of file