Versionierung mit django-simple-history

This commit is contained in:
2026-06-05 23:10:24 +02:00
committed by Hraban
parent 1f36f279ce
commit af8d1e3d2c
5 changed files with 17 additions and 4 deletions
+6 -3
View File
@@ -7,9 +7,11 @@ und für die öffentliche Rechercheplattform.
- Liederbücher
- Lieder
- Urheber*innen
- Verlage (TODO)
- Nutzungsrechte und ihre Inhaber*innen (TODO)
- Sammlung (private oder öffentliche Bibliothek von Liederbüchern)
- Urheber*innen (umgesetzt)
- Verlage
- Nutzungsrechte und ihre Inhaber*innen
- Versionierung
## Abhängigkeiten
@@ -17,6 +19,7 @@ und für die öffentliche Rechercheplattform.
- Django 6.0
- django-taggit
- django-taggit-helpers (uralt, funktioniert aber)
- django-simple-history
- PyYAML
## Installation
@@ -44,6 +44,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'simple-history',
]
MIDDLEWARE = [
@@ -54,6 +55,7 @@ MIDDLEWARE = [
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'simple_history.middleware.HistoryRequestMiddleware',
]
ROOT_URLCONF = 'liederquelle.urls'
+3
View File
@@ -4,6 +4,8 @@ from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelatio
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User
from .person import Person
from simple_history.models import HistoricalRecords
class AuthorURL(models.Model):
person = models.ForeignKey(Person,
@@ -74,6 +76,7 @@ class Contact(models.Model):
blank=True,
#help_text='',
)
history = HistoricalRecords()
class Meta:
verbose_name = 'Kontakt'
+5 -1
View File
@@ -1,6 +1,7 @@
from django.db import models
from taggit.managers import TaggableManager
from django.contrib.contenttypes.fields import GenericRelation
from simple_history.models import HistoricalRecords
class Person(models.Model):
@@ -45,6 +46,8 @@ class Person(models.Model):
#help_text='',
)
contacts = GenericRelation('Contact')
history = HistoricalRecords()
def alias(self):
return ','.join(n.alias for n in self.identity_set.all())
alias.verbose_name = 'Aliase'
@@ -87,7 +90,8 @@ class Identity(models.Model):
blank=True,
help_text='Kommaseparierte Stichwörter zu dieser Identität, z.B. "Bund:DPB,Band:Schlagsaite"',
verbose_name='Stichwörter'
)
)
history = HistoricalRecords()
class Meta:
verbose_name = 'Identität'
+1
View File
@@ -5,3 +5,4 @@ django>6,<7
django-dotenv
django-taggit
django-taggit-helpers
django-simple-history