All files for deployment ready and tested - further development in this repo.

This commit is contained in:
2025-09-22 10:42:52 +02:00
parent 57b738e9ce
commit 12c3181ad2
394 changed files with 89982 additions and 0 deletions

0
rollen/__init__.py Normal file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

19
rollen/admin.py Normal file
View File

@@ -0,0 +1,19 @@
from django.contrib import admin
from nested_admin import NestedStackedInline, NestedModelAdmin, NestedTabularInline
from django import forms
from .models import Rolle, RollenBeschreibung
class RollenBeschreibungInline(NestedStackedInline):
model = RollenBeschreibung
extra = 0
sortable_field_name = "order"
ordering = ("order",)
show_change_link = True
@admin.register(Rolle)
class RollenAdmin(NestedModelAdmin):
search_fields = ('name',)
ordering = ('name',)
inlines = [RollenBeschreibungInline]

6
rollen/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class RollenConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'rollen'

View File

@@ -0,0 +1,39 @@
# Generated by Django 5.2.5 on 2025-09-05 08:36
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('abschnitte', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Rolle',
fields=[
('name', models.CharField(max_length=100, primary_key=True, serialize=False)),
],
options={
'verbose_name_plural': 'Rollen',
},
),
migrations.CreateModel(
name='RollenBeschreibung',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('inhalt', models.TextField(blank=True, null=True)),
('order', models.PositiveIntegerField(default=0)),
('abschnitt', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rollen.rolle')),
('abschnitttyp', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='abschnitte.abschnitttyp')),
],
options={
'verbose_name': 'Rollenbeschreibungs-Abschnitt',
'verbose_name_plural': 'Rollenbeschreibung',
},
),
]

View File

Binary file not shown.

17
rollen/models.py Normal file
View File

@@ -0,0 +1,17 @@
from django.db import models
from abschnitte.models import Textabschnitt
# Create your models here.
class Rolle(models.Model):
name = models.CharField(max_length=100, primary_key=True)
def __str__(self):
return self.name
class Meta:
verbose_name_plural="Rollen"
class RollenBeschreibung(Textabschnitt):
abschnitt=models.ForeignKey(Rolle,on_delete=models.CASCADE)
class Meta:
verbose_name_plural="Rollenbeschreibung"
verbose_name="Rollenbeschreibungs-Abschnitt"

3
rollen/tests.py Normal file
View File

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

3
rollen/views.py Normal file
View File

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