All files for deployment ready and tested - further development in this repo.
This commit is contained in:
0
rollen/__init__.py
Normal file
0
rollen/__init__.py
Normal file
BIN
rollen/__pycache__/__init__.cpython-312.pyc
Normal file
BIN
rollen/__pycache__/__init__.cpython-312.pyc
Normal file
Binary file not shown.
BIN
rollen/__pycache__/admin.cpython-312.pyc
Normal file
BIN
rollen/__pycache__/admin.cpython-312.pyc
Normal file
Binary file not shown.
BIN
rollen/__pycache__/apps.cpython-312.pyc
Normal file
BIN
rollen/__pycache__/apps.cpython-312.pyc
Normal file
Binary file not shown.
BIN
rollen/__pycache__/models.cpython-312.pyc
Normal file
BIN
rollen/__pycache__/models.cpython-312.pyc
Normal file
Binary file not shown.
19
rollen/admin.py
Normal file
19
rollen/admin.py
Normal 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
6
rollen/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class RollenConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'rollen'
|
||||
39
rollen/migrations/0001_initial.py
Normal file
39
rollen/migrations/0001_initial.py
Normal 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',
|
||||
},
|
||||
),
|
||||
]
|
||||
0
rollen/migrations/__init__.py
Normal file
0
rollen/migrations/__init__.py
Normal file
BIN
rollen/migrations/__pycache__/0001_initial.cpython-312.pyc
Normal file
BIN
rollen/migrations/__pycache__/0001_initial.cpython-312.pyc
Normal file
Binary file not shown.
BIN
rollen/migrations/__pycache__/__init__.cpython-312.pyc
Normal file
BIN
rollen/migrations/__pycache__/__init__.cpython-312.pyc
Normal file
Binary file not shown.
17
rollen/models.py
Normal file
17
rollen/models.py
Normal 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
3
rollen/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
3
rollen/views.py
Normal file
3
rollen/views.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Reference in New Issue
Block a user