upload xls

This commit is contained in:
alazo 2017-04-25 21:07:48 +02:00
parent 7cd46f0fd5
commit 5221b2b068
9 changed files with 22 additions and 34 deletions

1
.gitignore vendored
View file

@ -7,5 +7,6 @@ db.*
*.csv
*.xls
*.xlsx
*.xls
.*

View file

@ -216,7 +216,12 @@ class UploadDoc(models.Model):
def __str__(self):
return self.titre
"""
class OffreEmploi(models.Model):
source = models.CharField(max_lenght=200, blank=False)
descr = model.HTMLField(blank=False)
published = models.BooleanField(default=False)
"""
class PDFResponse(HttpResponse):

View file

@ -172,6 +172,11 @@ class DocumentListView(ListView):
template_name = 'cms/document_list.html'
model = Document
def get_queryset(self, **kwargs):
query = Document.objects.filter(published=True)
return query
def get_context_data(self, **kwargs):
context = super(DocumentListView, self).get_context_data(**kwargs)
context['upload'] = UploadDoc.objects.filter(published=True)
@ -184,6 +189,10 @@ class DocumentDetailView(DetailView):
class UploadDetailView(DetailView):
"""
Affiche les documents uploadés à la suite des doc.
DocumentsInline
"""
template_name = 'cms/upload_detail.html'
model = UploadDoc
@ -249,7 +258,6 @@ class ModulePDF(DetailView):
doc = MyDocTemplate(response)
doc.build(response.story)
return response

View file

@ -39,5 +39,8 @@ urlpatterns = [
url(r'^documents/$', views.DocumentListView.as_view(), name='document-list'),
url(r'^document/(?P<pk>\d+)$', views.DocumentDetailView.as_view(), name='document-detail'),
url(r'^upload/(?P<pk>\d+)$', views.UploadDetailView.as_view(), name='upload-detail'),
#url(r'^emplois/$', views.EmploiListView.as_view(), name='emploi-list'),
url(r'^tinymce/', include('tinymce.urls'), name='tinymce-js'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT )

Binary file not shown.

Binary file not shown.

View file

@ -18,7 +18,7 @@
{% endfor %}
{% for fic in upload %}
<li><a href="{% url 'upload-detail' fic.id %}">{{ fic.titre }} (pdf)</a></li>
<li><a href="{% url 'upload-detail' fic.id %}">{{ fic.titre }}</a></li>
{% endfor %}

View file

@ -1,29 +0,0 @@
{% extends "./base_site.html" %}
{% load i18n static %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />
<link rel="stylesheet" type="text/css" href="{% static "css/main.css" %}" />{% endblock %}
{% block coltype %}colMS{% endblock %}
{% block bodyclass %}{{ block.super }} dashboard{% endblock %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'home' %}">Accueil</a>
<a href="{% url 'document' %}">Document</a>
</div>
{% endblock %}
{% block content %}
<div id="content-main">
<h1>Documents utiles</h1>
<ul>
<li><a href=""
</ul>
</div>
{% endblock %}

View file

@ -34,7 +34,7 @@
</tr>
<tr>
<td></td><td class="l1 m">{{M04.url_code|safe}}</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
<td></td><td class="l1 m">{{ M04.url_code|safe }}</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
</tr>
<!-- Ligne 2 -->
<tr>