1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2025-07-07 16:28:32 +02:00

Translate models in english

This commit is contained in:
2021-10-23 18:31:03 +02:00
parent 2a17a32d4c
commit 52ecd59bf6
21 changed files with 210 additions and 155 deletions

View File

@ -13,7 +13,7 @@ from django.db.models import QuerySet
from django.forms import ModelForm
from django.utils.translation import gettext_lazy as _
from .models import Auteur, BD
from .models import Author, Comic
from .scraper import BedetequeScraper
@ -123,7 +123,7 @@ class MediaAdminForm(ModelForm):
self.cleaned_data["publish_date"] += "-01"
self.cleaned_data["number_of_pages"] = data["pages"]
self.cleaned_data["authors"] = \
list(Auteur.objects.get_or_create(name=author_name)[0]
list(Author.objects.get_or_create(name=author_name)[0]
for author_name in data["authors"])
self.cleaned_data["external_url"] = data["image"]
return True
@ -195,7 +195,7 @@ class MediaAdminForm(ModelForm):
if 'authors' in info:
for author in info['authors']:
author_obj = Auteur.objects.get_or_create(
author_obj = Author.objects.get_or_create(
name=author)[0]
self.cleaned_data['authors'].append(author_obj)
@ -269,7 +269,7 @@ class MediaAdminForm(ModelForm):
if 'authors' in data:
for author in data['authors']:
author_obj = Auteur.objects.get_or_create(
author_obj = Author.objects.get_or_create(
name=author['name'])[0]
self.cleaned_data['authors'].append(author_obj)
@ -343,7 +343,7 @@ class MediaAdminForm(ModelForm):
self.add_error(name, e)
class Meta:
model = BD
model = Comic
fields = ('isbn', 'title', 'subtitle', 'external_url',
'side_identifier', 'authors', 'number_of_pages',
'publish_date', 'present', )