Unverified Commit 975d3d4a authored by Joost Rijneveld's avatar Joost Rijneveld
Browse files

Rename generic documents to miscellaneous

parent 2fb85e3b
from django.contrib import admin
from documents.models import AssociationDocumentsYear
from documents.models import GenericDocument
from documents.models import MiscellaneousDocument
from documents.models import GeneralMeeting, GeneralMeetingDocument
......@@ -14,5 +14,5 @@ class GeneralMeetingAdmin(admin.ModelAdmin):
inlines = (GeneralMeetingDocInline, )
admin.site.register(GenericDocument)
admin.site.register(MiscellaneousDocument)
admin.site.register(AssociationDocumentsYear)
# -*- coding: utf-8 -*-
# Generated by Django 1.10b1 on 2016-07-24 11:14
from __future__ import unicode_literals
from django.db import migrations, models
import utils.validators
class Migration(migrations.Migration):
dependencies = [
('documents', '0002_auto_20160723_1247'),
]
operations = [
migrations.CreateModel(
name='MiscellaneousDocument',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('file', models.FileField(upload_to='documents/miscellaneous/', validators=[utils.validators.validate_file_extension])),
('members_only', models.BooleanField(default=False)),
],
),
migrations.DeleteModel(
name='GenericDocument',
),
]
......@@ -29,10 +29,10 @@ class AssociationDocumentsYear(models.Model):
return "{}-{}".format(self.year, self.year + 1)
class GenericDocument(models.Model):
class MiscellaneousDocument(models.Model):
name = models.CharField(max_length=200)
file = models.FileField(
upload_to='documents/generic/',
upload_to='documents/miscellaneous/',
validators=[validate_file_extension],
)
members_only = models.BooleanField(default=False)
......
......@@ -16,8 +16,8 @@
<div class="portfolio">
<ul class="portfolio-posts row generalcontainer">
{% for generic_document in generic_documents %}
{% include 'documents/generic.html' with document=generic_document %}
{% for miscellaneous_document in miscellaneous_documents %}
{% include 'documents/miscellaneous.html' with document=miscellaneous_document %}
{% endfor %}
</ul>
</div>
......
from django.shortcuts import render
from django.utils import timezone
from documents.models import AssociationDocumentsYear, GenericDocument
from documents.models import AssociationDocumentsYear, MiscellaneousDocument
def index(request):
......@@ -20,7 +20,7 @@ def index(request):
except ValueError:
docs.remove(doc)
context = {'generic_documents': GenericDocument.objects.all(),
context = {'miscellaneous_documents': MiscellaneousDocument.objects.all(),
'association_documents_years': sorted(years.items(),
reverse=True),
# TODO ideally we want to do this dynamically in CSS
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment