diff --git a/db.sqlite3 b/db.sqlite3 index f2574ce..f70068f 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/mensa_app/__pycache__/__init__.cpython-314.pyc b/mensa_app/__pycache__/__init__.cpython-314.pyc index ac18d10..46c3669 100644 Binary files a/mensa_app/__pycache__/__init__.cpython-314.pyc and b/mensa_app/__pycache__/__init__.cpython-314.pyc differ diff --git a/mensa_app/__pycache__/admin.cpython-314.pyc b/mensa_app/__pycache__/admin.cpython-314.pyc index de80568..a5ef4df 100644 Binary files a/mensa_app/__pycache__/admin.cpython-314.pyc and b/mensa_app/__pycache__/admin.cpython-314.pyc differ diff --git a/mensa_app/__pycache__/apps.cpython-314.pyc b/mensa_app/__pycache__/apps.cpython-314.pyc index 7d5b56e..13e3337 100644 Binary files a/mensa_app/__pycache__/apps.cpython-314.pyc and b/mensa_app/__pycache__/apps.cpython-314.pyc differ diff --git a/mensa_app/__pycache__/models.cpython-314.pyc b/mensa_app/__pycache__/models.cpython-314.pyc index e0fd0fa..010479e 100644 Binary files a/mensa_app/__pycache__/models.cpython-314.pyc and b/mensa_app/__pycache__/models.cpython-314.pyc differ diff --git a/mensa_app/__pycache__/urls.cpython-314.pyc b/mensa_app/__pycache__/urls.cpython-314.pyc new file mode 100644 index 0000000..b35e61b Binary files /dev/null and b/mensa_app/__pycache__/urls.cpython-314.pyc differ diff --git a/mensa_app/__pycache__/views.cpython-314.pyc b/mensa_app/__pycache__/views.cpython-314.pyc new file mode 100644 index 0000000..22b19f4 Binary files /dev/null and b/mensa_app/__pycache__/views.cpython-314.pyc differ diff --git a/mensa_app/migrations/__pycache__/0001_initial.cpython-314.pyc b/mensa_app/migrations/__pycache__/0001_initial.cpython-314.pyc index 42952ee..190f65f 100644 Binary files a/mensa_app/migrations/__pycache__/0001_initial.cpython-314.pyc and b/mensa_app/migrations/__pycache__/0001_initial.cpython-314.pyc differ diff --git a/mensa_app/migrations/__pycache__/0002_alter_bestellung_options_alter_gericht_options_and_more.cpython-314.pyc b/mensa_app/migrations/__pycache__/0002_alter_bestellung_options_alter_gericht_options_and_more.cpython-314.pyc index 973cd09..cae7689 100644 Binary files a/mensa_app/migrations/__pycache__/0002_alter_bestellung_options_alter_gericht_options_and_more.cpython-314.pyc and b/mensa_app/migrations/__pycache__/0002_alter_bestellung_options_alter_gericht_options_and_more.cpython-314.pyc differ diff --git a/mensa_app/migrations/__pycache__/0003_schulwoche_alter_gericht_time_creation_and_more.cpython-314.pyc b/mensa_app/migrations/__pycache__/0003_schulwoche_alter_gericht_time_creation_and_more.cpython-314.pyc index a82d32d..680e53d 100644 Binary files a/mensa_app/migrations/__pycache__/0003_schulwoche_alter_gericht_time_creation_and_more.cpython-314.pyc and b/mensa_app/migrations/__pycache__/0003_schulwoche_alter_gericht_time_creation_and_more.cpython-314.pyc differ diff --git a/mensa_app/migrations/__pycache__/0004_alter_gericht_time_creation_and_more.cpython-314.pyc b/mensa_app/migrations/__pycache__/0004_alter_gericht_time_creation_and_more.cpython-314.pyc index f97feed..c33415e 100644 Binary files a/mensa_app/migrations/__pycache__/0004_alter_gericht_time_creation_and_more.cpython-314.pyc and b/mensa_app/migrations/__pycache__/0004_alter_gericht_time_creation_and_more.cpython-314.pyc differ diff --git a/mensa_app/migrations/__pycache__/__init__.cpython-314.pyc b/mensa_app/migrations/__pycache__/__init__.cpython-314.pyc index 2acbc8d..cc7d1ea 100644 Binary files a/mensa_app/migrations/__pycache__/__init__.cpython-314.pyc and b/mensa_app/migrations/__pycache__/__init__.cpython-314.pyc differ diff --git a/mensa_app/templates/mensa_app/gericht_list.html b/mensa_app/templates/mensa_app/gericht_list.html new file mode 100644 index 0000000..4b4f375 --- /dev/null +++ b/mensa_app/templates/mensa_app/gericht_list.html @@ -0,0 +1,55 @@ + + + + + + Mensa-Speisekarte + + + + + +
+
+
+
+
+

Unsere Speisekarte

+
+
+ + + + + + + + + + {% for gericht in alle_gerichte %} + + + + + + {% empty %} + + + + {% endfor %} + +
GerichtKategorieStatus
{{ gericht.name }}{{ gericht.kategorie.name }} + {% if gericht.ist_dauerangebot %} + Dauerangebot + {% else %} + Tagesangebot + {% endif %} +
Keine Gerichte im System gefunden.
+
+
+
+
+
+ + + diff --git a/mensa_app/urls.py b/mensa_app/urls.py new file mode 100644 index 0000000..a191ae4 --- /dev/null +++ b/mensa_app/urls.py @@ -0,0 +1,6 @@ +from django.urls import path +from .views import GerichtListView + +urlpatterns = [ + path('speisekarte/', GerichtListView.as_view(), name='gericht_list'), +] diff --git a/mensa_app/views.py b/mensa_app/views.py index 91ea44a..b8aafaa 100644 --- a/mensa_app/views.py +++ b/mensa_app/views.py @@ -1,3 +1,11 @@ from django.shortcuts import render # Create your views here. +from django.views.generic import ListView +from .models import Gericht + +class GerichtListView(ListView): + model = Gericht + template_name = 'mensa_app/gericht_liste.html' # Der Pfad zum Template + context_object_name = 'alle_gerichte' # Der Name, den wir im Template nutzen + diff --git a/mensa_core/__pycache__/__init__.cpython-314.pyc b/mensa_core/__pycache__/__init__.cpython-314.pyc index c6998ec..f6c0a1c 100644 Binary files a/mensa_core/__pycache__/__init__.cpython-314.pyc and b/mensa_core/__pycache__/__init__.cpython-314.pyc differ diff --git a/mensa_core/__pycache__/settings.cpython-314.pyc b/mensa_core/__pycache__/settings.cpython-314.pyc index ddbc640..4d35f6d 100644 Binary files a/mensa_core/__pycache__/settings.cpython-314.pyc and b/mensa_core/__pycache__/settings.cpython-314.pyc differ diff --git a/mensa_core/__pycache__/urls.cpython-314.pyc b/mensa_core/__pycache__/urls.cpython-314.pyc index 262e0fa..05686aa 100644 Binary files a/mensa_core/__pycache__/urls.cpython-314.pyc and b/mensa_core/__pycache__/urls.cpython-314.pyc differ diff --git a/mensa_core/__pycache__/wsgi.cpython-314.pyc b/mensa_core/__pycache__/wsgi.cpython-314.pyc index b95635b..ebd799d 100644 Binary files a/mensa_core/__pycache__/wsgi.cpython-314.pyc and b/mensa_core/__pycache__/wsgi.cpython-314.pyc differ diff --git a/mensa_core/urls.py b/mensa_core/urls.py index 29c5021..da1dfc9 100644 --- a/mensa_core/urls.py +++ b/mensa_core/urls.py @@ -15,8 +15,9 @@ 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 urlpatterns = [ path('admin/', admin.site.urls), + path('', include('mensa_app.urls')), # Schaltet die App-URLs frei ]