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