Got my music working again
This commit is contained in:
parent
d7892d355d
commit
928173976b
@ -25,5 +25,5 @@ class PlaylistAddForm(forms.Form):
|
||||
def save(self):
|
||||
self.instance.works.add(self.cleaned_data['work'])
|
||||
|
||||
class ProjectSelectForm(forms.Form):
|
||||
class ProjectSelectForm(BaseForm):
|
||||
project = forms.ModelChoiceField(queryset=Project.objects.all())
|
||||
@ -63,7 +63,7 @@
|
||||
<td>{{ forloop.counter }}.</td>
|
||||
<td>
|
||||
{% if request.is_admin %}
|
||||
<a href="{% url 'work_detail' item.work.pk %}">{{ item.work.name }}</a>
|
||||
<a href="{% url 'work_detail' item.work.collection.pk item.work.pk %}">{{ item.work.name }}</a>
|
||||
{% else %}
|
||||
{{ item.work.name }}
|
||||
{% endif %}
|
||||
@ -75,7 +75,7 @@
|
||||
<select name="instruments">
|
||||
<option value='-'>None</option>
|
||||
{% for part in item.work.digital_parts %}
|
||||
<option value='{{ part.tag }}'>{{ part.instrument }}</option>
|
||||
<option value='{{ part.tag }}'>{{ part.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</span>
|
||||
|
||||
@ -30,9 +30,7 @@ class ProjectItemListView(ProjectMixin, ListView):
|
||||
|
||||
def post(self, request, **kwargs):
|
||||
|
||||
project = self.get_project()
|
||||
|
||||
project_works = project.works.all()
|
||||
project_works = self.project.works.all()
|
||||
|
||||
instruments = request.POST.getlist('instruments')
|
||||
works = request.POST.getlist('works')
|
||||
@ -58,7 +56,7 @@ class ProjectItemListView(ProjectMixin, ListView):
|
||||
|
||||
result = extract_and_concat(sections)
|
||||
|
||||
download_name = f'{project.name}.pdf'
|
||||
download_name = f'{self.project.name}.pdf'
|
||||
|
||||
response = FileResponse(result, content_type="application/pdf")
|
||||
response['Content-Disposition'] = f'inline; filename="{download_name}"'
|
||||
@ -74,10 +72,6 @@ class ProjectItemListView(ProjectMixin, ListView):
|
||||
data['instrument'] = self.request.session.get('instrument', 'Score')
|
||||
data['part'] = self.request.session.get('part', '0')
|
||||
data['running_time'] = self.get_queryset().aggregate(Sum('work__running_time'))['work__running_time__sum']
|
||||
#if running_time:
|
||||
# data['running_time'] = "{0:d}:{1:02d}".format(int(running_time / 60), running_time % 60)
|
||||
#else:
|
||||
# data['running_time'] = "-:--"
|
||||
return data
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user