Minor tweaks
This commit is contained in:
parent
6e0d34fbd0
commit
579f4c4b57
|
@ -50,7 +50,7 @@ class Release(models.Model):
|
||||||
TYPE_HINT = 'full-length (0), EP (1), Split (2), Démo (3)'
|
TYPE_HINT = 'full-length (0), EP (1), Split (2), Démo (3)'
|
||||||
EMBED_HINT = 'HTML iframe -- for Bandcamp, add the whole tracklist'
|
EMBED_HINT = 'HTML iframe -- for Bandcamp, add the whole tracklist'
|
||||||
|
|
||||||
ident = models.IntegerField()
|
ident = models.IntegerField(unique=True)
|
||||||
title = models.CharField(max_length=256)
|
title = models.CharField(max_length=256)
|
||||||
contributors = models.ManyToManyField(Artist)
|
contributors = models.ManyToManyField(Artist)
|
||||||
release_type = models.IntegerField(default=0, help_text=TYPE_HINT)
|
release_type = models.IntegerField(default=0, help_text=TYPE_HINT)
|
||||||
|
@ -63,7 +63,7 @@ class Release(models.Model):
|
||||||
return self.title
|
return self.title
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
ordering = ('ident', 'title')
|
ordering = ('-ident',)
|
||||||
|
|
||||||
|
|
||||||
class VideoClip(models.Model):
|
class VideoClip(models.Model):
|
||||||
|
@ -78,4 +78,4 @@ class VideoClip(models.Model):
|
||||||
return self.title
|
return self.title
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
ordering = ('year', 'title')
|
ordering = ('-year', 'title')
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h1>Core</h1>
|
<h1>Core</h1>
|
||||||
<p>Main project roster of Idre</p>
|
<p>Main projects roster of Idre</p>
|
||||||
|
|
||||||
<div class="artists">
|
<div class="artists">
|
||||||
{% for artist in artists %}
|
{% for artist in artists %}
|
||||||
|
|
|
@ -21,7 +21,7 @@ def artist_view(request, slug):
|
||||||
|
|
||||||
releases = artist.release_set.all()
|
releases = artist.release_set.all()
|
||||||
for release in releases:
|
for release in releases:
|
||||||
release.tag = tools.get_catalog_tag_from_id(release.ident)
|
release.tag = get_catalog_tag_from_id(release.ident)
|
||||||
|
|
||||||
context = { 'artist': artist, 'releases': releases }
|
context = { 'artist': artist, 'releases': releases }
|
||||||
return render(request, 'label/artist.html', context)
|
return render(request, 'label/artist.html', context)
|
||||||
|
@ -33,13 +33,13 @@ def releases_view(request):
|
||||||
|
|
||||||
releases_and_infos = []
|
releases_and_infos = []
|
||||||
for release in releases:
|
for release in releases:
|
||||||
release_tag = tools.get_catalog_tag_from_id(release.ident)
|
release_tag = get_catalog_tag_from_id(release.ident)
|
||||||
releases_and_infos.append({
|
releases_and_infos.append({
|
||||||
'id': release.id,
|
'id': release.id,
|
||||||
'release_type': release.release_type,
|
'release_type': release.release_type,
|
||||||
'tag': release_tag,
|
'tag': release_tag,
|
||||||
'title': release.title,
|
'title': release.title,
|
||||||
'contribs': tools.get_contribs(release.contributors.all()),
|
'contribs': get_contribs(release.contributors.all()),
|
||||||
'year': release.year,
|
'year': release.year,
|
||||||
'cover': release.cover,
|
'cover': release.cover,
|
||||||
})
|
})
|
||||||
|
@ -49,14 +49,14 @@ def releases_view(request):
|
||||||
|
|
||||||
|
|
||||||
def release_view(request, tag):
|
def release_view(request, tag):
|
||||||
ident = tools.get_id_from_catalog_tag(tag)
|
ident = get_id_from_catalog_tag(tag)
|
||||||
release = get_object_or_404(Release, ident = ident)
|
release = get_object_or_404(Release, ident = ident)
|
||||||
contribs = tools.get_contribs(release.contributors.all())
|
contribs = get_contribs(release.contributors.all())
|
||||||
context = { 'release': release, 'contribs': contribs }
|
context = { 'release': release, 'contribs': contribs }
|
||||||
return render(request, 'label/release.html', context)
|
return render(request, 'label/release.html', context)
|
||||||
|
|
||||||
|
|
||||||
def videos_view(request):
|
def videos_view(request):
|
||||||
videos = VideoClip.objects.all()
|
videos = VideoClip.objects.order_by('-year', 'title')
|
||||||
context = { 'videos': videos }
|
context = { 'videos': videos }
|
||||||
return render(request, 'label/videos.html', context)
|
return render(request, 'label/videos.html', context)
|
||||||
|
|
Loading…
Reference in a new issue