fix: fix field type
This commit is contained in:
parent
223c9f2f9b
commit
11d5e2a9ee
@ -0,0 +1,33 @@
|
|||||||
|
# Generated by Django 5.0.3 on 2024-04-14 12:06
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("fellchensammlung", "0004_alter_text_options"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="text",
|
||||||
|
name="content",
|
||||||
|
field=models.TextField(verbose_name="Inhalt"),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="text",
|
||||||
|
name="language",
|
||||||
|
field=models.OneToOneField(
|
||||||
|
on_delete=django.db.models.deletion.PROTECT,
|
||||||
|
to="fellchensammlung.language",
|
||||||
|
verbose_name="Sprache",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="text",
|
||||||
|
name="text_code",
|
||||||
|
field=models.CharField(blank=True, max_length=24, verbose_name="Text code"),
|
||||||
|
),
|
||||||
|
]
|
23
src/fellchensammlung/migrations/0006_alter_text_language.py
Normal file
23
src/fellchensammlung/migrations/0006_alter_text_language.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Generated by Django 5.0.3 on 2024-04-14 12:12
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("fellchensammlung", "0005_alter_text_content_alter_text_language_and_more"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="text",
|
||||||
|
name="language",
|
||||||
|
field=models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.PROTECT,
|
||||||
|
to="fellchensammlung.language",
|
||||||
|
verbose_name="Sprache",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
@ -333,7 +333,7 @@ class Text(models.Model):
|
|||||||
"""
|
"""
|
||||||
title = models.CharField(max_length=100)
|
title = models.CharField(max_length=100)
|
||||||
content = models.TextField(verbose_name="Inhalt")
|
content = models.TextField(verbose_name="Inhalt")
|
||||||
language = models.OneToOneField(Language, verbose_name="Sprache", on_delete=models.PROTECT)
|
language = models.ForeignKey(Language, verbose_name="Sprache", on_delete=models.PROTECT)
|
||||||
text_code = models.CharField(max_length=24, verbose_name="Text code", blank=True)
|
text_code = models.CharField(max_length=24, verbose_name="Text code", blank=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
@ -341,4 +341,4 @@ class Text(models.Model):
|
|||||||
verbose_name_plural = "Texte"
|
verbose_name_plural = "Texte"
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.title
|
return f"{self.title} ({self.language})"
|
||||||
|
Loading…
Reference in New Issue
Block a user