[fix] no title __str__ and remove h2 from template
parent
ceb3035bd8
commit
af8d71a4ea
|
|
@ -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"
|
||||||
|
|
|
||||||
|
|
@ -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']
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue