[fix] no title __str__ and remove h2 from template

main
yaemiku 2022-07-25 22:41:03 +02:00
parent ceb3035bd8
commit af8d71a4ea
Signed by: podlaskizbs
GPG Key ID: ADC039636B3E4AAB
3 changed files with 4 additions and 2 deletions

View File

@ -10,7 +10,9 @@
<article <article
class="prose prose-a:text-center bg-white rounded-md shadow-md p-4 pb-6" class="prose prose-a:text-center bg-white rounded-md shadow-md p-4 pb-6"
> >
{% if tournament.title %}
<h2>{{ tournament.title }}</h2> <h2>{{ tournament.title }}</h2>
{% endif %}
<figure> <figure>
<a href="{{ tournament.link }}" target="_blank" <a href="{{ tournament.link }}" target="_blank"
><img src="{{ tournament.photo.url }}" alt="" class="max-h-72 mx-auto" ><img src="{{ tournament.photo.url }}" alt="" class="max-h-72 mx-auto"

View File

@ -7,7 +7,7 @@ from .models import *
@admin.register(Tournament) @admin.register(Tournament)
class TournamentModelAdmin(OrderableAdmin, admin.ModelAdmin): class TournamentModelAdmin(OrderableAdmin, admin.ModelAdmin):
list_display = ['title', 'ordering'] list_display = ['__str__', 'ordering']
list_editable = ['ordering'] list_editable = ['ordering']
ordering_field_hide_input = True ordering_field_hide_input = True
exclude = ['ordering'] exclude = ['ordering']

View File

@ -14,7 +14,7 @@ class Tournament(OrderableModel):
link = models.TextField('Link do wyników') link = models.TextField('Link do wyników')
def __str__(self): def __str__(self):
return self.title return self.title or '(bez tytułu)'
class Meta(OrderableModel.Meta): class Meta(OrderableModel.Meta):
verbose_name = 'Inny turniej' verbose_name = 'Inny turniej'