From 04004b2a858802e13b4b27370f98cb6da809ea21 Mon Sep 17 00:00:00 2001 From: Davin Baragiotta Date: Mon, 16 Jul 2012 17:08:39 -0400 Subject: [PATCH 1/1] projet cartographie preuve concept francis.ngatsi --- .gitignore | 31 +++++ projets/cartographie/carto/carto | Bin 0 -> 43008 bytes projets/cartographie/carto/formation/admin.py | 30 +++++ projets/cartographie/carto/formation/fiche.py | 88 +++++++++++++++ projets/cartographie/carto/formation/forms.py | 88 +++++++++++++++ projets/cartographie/carto/formation/models.py | 119 ++++++++++++++++++++ projets/cartographie/carto/formation/tests.py | 23 ++++ projets/cartographie/carto/formation/views.py | 57 ++++++++++ projets/cartographie/carto/manage.py | 11 ++ projets/cartographie/carto/settings.py | 86 ++++++++++++++ projets/cartographie/carto/template/base.html | 15 +++ projets/cartographie/carto/template/formation.xml | 99 ++++++++++++++++ projets/cartographie/carto/template/main_page.html | 19 ++++ .../carto/template/saisie/apres_saisie.html | 11 ++ .../carto/template/saisie/form_formation.html | 12 ++ projets/cartographie/carto/urls.py | 28 +++++ 16 files changed, 717 insertions(+) create mode 100644 .gitignore create mode 100644 projets/cartographie/carto/__init__.py create mode 100644 projets/cartographie/carto/carto create mode 100644 projets/cartographie/carto/formation/__init__.py create mode 100644 projets/cartographie/carto/formation/admin.py create mode 100644 projets/cartographie/carto/formation/fiche.py create mode 100644 projets/cartographie/carto/formation/forms.py create mode 100644 projets/cartographie/carto/formation/models.py create mode 100644 projets/cartographie/carto/formation/tests.py create mode 100644 projets/cartographie/carto/formation/views.py create mode 100755 projets/cartographie/carto/manage.py create mode 100644 projets/cartographie/carto/settings.py create mode 100644 projets/cartographie/carto/template/base.html create mode 100644 projets/cartographie/carto/template/formation.xml create mode 100644 projets/cartographie/carto/template/main_page.html create mode 100644 projets/cartographie/carto/template/saisie/apres_saisie.html create mode 100755 projets/cartographie/carto/template/saisie/form_formation.html create mode 100644 projets/cartographie/carto/urls.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d7fe567 --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +# binaires +*.pyc +*.pyo + +# Fichier temporaires: +.*.swp +*~ +\#*# +# src/* + +# DB de dev +*.db + +# restants de merge +*.orig +*.rej + +# Configuration du projet - par environnement +conf.py +django.wsgi +local.cfg + +# buildout +.installed.cfg +bin +develop-eggs +downloads +eggs +log +parts +tmp diff --git a/projets/cartographie/carto/__init__.py b/projets/cartographie/carto/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/projets/cartographie/carto/carto b/projets/cartographie/carto/carto new file mode 100644 index 0000000000000000000000000000000000000000..d16175e7aaf0fb7aa3928b4bd48946365f13e895 GIT binary patch literal 43008 zcmeHQdu$uYdEeP3MT=)zC(APZI9p@cvcy=TxqL{XF4u%7(TeUY$(F41$&M>5$(6J= z$)&lZ{OBvP^DO#8kN{2p2-5zMoZFy9+aOJmA}FBz)1qh#^nn0L10+b3AZ>#7kOpXi z7X7~2*#{r8eD?Wz_AOzLc4xo&=9_P3zM1)E_P2}Y&uTT5uIkm2QlkmMClDgMmr_9x zuET%#Z!g>sSA_f872SI2hbX`FJ$!IX`kC|-=|81^H*Z^My%Eh}18J!;11*Ol^`JO0Q%ABm8lQYg5HpWE*vBczivG3R)iUOsF_ za~^i|p&lO@B%R2@jyu@vBd5qN&Y`HUspVSr)&Vn?Gq7UAdwpbp?85X`)c$TCIZgsR zxdAiHUNeR##h872eB=lTU^2YzVFl^1lBk9O67Mx5tyE@YH)GYo5}Gm39`F&F_<7pA zUIwMrYPTwCm-&FFcRkp{O5#TzuGkRE&d2$bfVr}!?lvPi4<7jplfj4Sc}$SSNIY%b zP^+D03{QwLyI7GWOog`rrZ|x&S*z;xN{1Q6)37Limyh%j5fia{A8QGOr>dyclE!o; znejZS6E8CP38r@;G^6dh#UnH1Ieyfa5=r>H_@p zex3$A4ZIZ^*xW^S3*k^`&>)0lGD@MOmGiK~)8DJqSEG7$%~)6D6S0(%N}Y(Mleu($ zG*w8)bGdv>i79eyEH_>#$g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&Ybzi7L3Rs2ovKy`N3VCI>X-}@TWWqkW1>e_7CBblwH)H~%SSyGjaG!;~ zeGYL9q33lz!^NL(;Ve(2#-s5ukbaDGCZ_Z}te=z`AQ5WNudv^niz9>PS&TUam^?cJ z+}&bKuB+O$b(#UxQaYvS6|_oI$~Bm;4J}P(rob|=yDMZlXqNGMvn0vXL^2gkjK*Yn zoCL?*%z;;Xs6{ZM_Jb?r{hcQ38!fD%EhKPs92b{Ihec>Zxp_OY# z23`n-y81rYCypd+jXs{?-x>Xxnz=sI1ae z@txZ~I#L&`r8;+)s09^jELw;4YSbv7c3b)f9HIEqsbCI-;P-$j?=Zby2Y&)KXBZG+ zEx+cPbq{5yvgenw5mg9Irnv-qkwxdz=5M1w~X4>Yq0XS(3yd~Uc!4QE&5gfD17TRaOr}l1o(k#%XHBo zEI0SOA{#(iHD?DCjh;9-pHl~?0=oT}V}zmJvn4%fOsztD01t5^9CW>!1F21E!Lh4W z!T*ht*wp|t0`zH^r3F_7fEO?lh(paV(-TGeX>8}07{sao=vC&xP+-NRRx>5^z0nKn Qa9!5vv~o*zR@uV;0Z~i={{R30 literal 0 HcmV?d00001 diff --git a/projets/cartographie/carto/formation/__init__.py b/projets/cartographie/carto/formation/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/projets/cartographie/carto/formation/admin.py b/projets/cartographie/carto/formation/admin.py new file mode 100644 index 0000000..0e3b550 --- /dev/null +++ b/projets/cartographie/carto/formation/admin.py @@ -0,0 +1,30 @@ +# -=- encoding: utf-8 -=- + +from django.contrib import admin + +from formation.models import * + +class FormationAdmin(admin.ModelAdmin): + search_fields = ('intitule',) + list_display = ('intitule','sigle',) + list_filter = ('etablissement',) + + fieldsets = ( + ('Dilplôme', { + 'fields': ('intitule', 'sigle', 'traduction', 'type_diplome', 'discipline_auf', 'niveau_entree', 'niveau_sortie', 'homologation', 'delivrance', 'vocation', 'debouches', 'url',) + }), + ('Etablissement(s)', { + 'fields': ('etablissement','composante', 'pays', 'ville', 'url_comp',) + }), + ('Organisation de la formation', { + 'fields': ('presentation', 'duree', 'type_formation', 'langue', 'admision', 'cout', 'respo', 'co_respo',) + }), + ) + +class PartenaireAdmin(admin.ModelAdmin): + search_fields = ('nom_partner',) + list_display = ('nom_partner','sigle_partner',) + + +admin.site.register(Formation, FormationAdmin) +admin.site.register(Partenaire, PartenaireAdmin) diff --git a/projets/cartographie/carto/formation/fiche.py b/projets/cartographie/carto/formation/fiche.py new file mode 100644 index 0000000..038f8cb --- /dev/null +++ b/projets/cartographie/carto/formation/fiche.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- + +from django import forms +import re +#from django.contrib.auth.models import User +from django.core.exceptions import ObjectDoesNotExist +#from django.contrib.comments.models import Comments + +from formation.models import * + + +typediplome = ( + (u'DN', u"Diplôme National"), + (u'DS', u'Diplôme de structure de la structure d\'accueil'), + (u'CE', u'Cerficat'), +) + +delivre_par = ( + (u'DS', u"Diplôme de la Structure d'accueil"), + (u'DO', u'Diplôme d\'un organisme partenaire'), + (u'CD', u'Codiplôme'), + (u'DD', u'Double diplôme'), +) + +t_formation = ( + (u'1', u"Ouverte à distance"), + (u'2', u"Uniquement en présentiel"), + (u'3', u"Mixte"), +) + +genre = ( + (u'M', u"Mademoiselle"), + (u'F', u"Madame"), + (u'F', u"Monsieur"), + ) +niveau_dpl = ( + (u'MI', u"Maîtrise"), + (u'MA', u"Master"), + (u'MG', u"Magistère"), + (u'DE', u"DESS"), + (u'DI', u"Diplôme d'Ingenieur"), + (u'DO', u"Doctorat"), + (u'DP', u"PhD"), + ) + + +class FormationClient(forms.Form): + """"Une formation est dispensé par un étblissement, concerne un domaine et a un niveau (type de formation) + Une formation se fait en présentiel, à distance ou combine les deux modes et pendant une durée précise. + """ + + + #domaine = models.CharField(max_length=256, label='Domaine de la formation') + #diplome = models.CharField(max_length=256, label='Dipplôme') + + #Identification de la formation + intitule = forms.CharField(max_length=512, label='Intitulé de la formation') + sigle = forms.CharField(max_length=32, label='Sigle de la formation', required=False) + traduction = forms.CharField(max_length=512, label='Traduction en français', required=True) + type_diplome = forms.ChoiceField(typediplome, label='Type de diplôme') + discipline_auf = forms.CharField(max_length=255, label='Disciple(s) AUF', help_text='Si plusieurs, séparez par les points virgules') + niveau_entree = forms.CharField(max_length=128, label='Niveau d\'entrée', help_text='Formulez-le en nombre d\'années d\'étude dans l\'enseignement supérieur') + niveau_sortie = forms.CharField(max_length=128, label='Niveau de sortie', help_text='Formulez-le en nombre d\'années d\'étude dans l\'enseignement supérieur') + homologation = forms.ChoiceField(delivre_par, label='Délivrance du diplôme') + delivrance = forms.ChoiceField(delivre_par, label='Délivrance du diplôme') + vocation = forms.CharField(max_length=128, help_text='Saisir professionnelle et/ou recherche') + debouches = forms.TextInput(attrs={'size': 64}) + url = forms.URLField(max_length=128, label='Lien Internet de la formation', required=False) + + #Etablissement(s) + etablissement = forms.CharField(max_length=256, label='Structure d\'accueil', help_text='Format: Nom_Etablissement(SIGLE)') + composante = forms.CharField(max_length=256, label='Composante', help_text='Format: Nom_Composante(SIGLE)', required=False) + pays = forms.CharField(max_length=256, label='Pays') + ville = forms.CharField(max_length=256, label='Ville') + url_comp = forms.CharField(max_length=256, label='Lien Internet', required=False) + partenaire_mbre = forms.CharField(max_length=512, label='Etablisements partenaires membre', help_text='Entrez la liste séparée par un point virgule', required=False) + partenaire = forms.CharField(max_length=512, label='Autres partenaires', help_text='Entrez la lisete séparée par un point virgule', required=False) + + #Organisation de la formation + presentation = forms.forms.TextInput(attrs={'size': 64}) + duree = forms.CharField(max_length=128, label='Durée de la formation') + type_formation = forms.ChoiceField(t_formation) + langue = forms.CharField(max_length=64, label='Langue\(s\) d\'enseignement', help_text='Si plusieurs, séparez par le point virgule') + admision = forms.CharField(max_length=256, required=False) + cout = forms.FloatField(label='Coût de la formation', required=False) + respo = forms.CharField(max_length=255, label='Responsable de la formation', required=False) + co_respo = forms.CharField(max_length=255, label='Co-responsable', required=False) + date_saisie = forms.DateField() diff --git a/projets/cartographie/carto/formation/forms.py b/projets/cartographie/carto/formation/forms.py new file mode 100644 index 0000000..338dc4b --- /dev/null +++ b/projets/cartographie/carto/formation/forms.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- + +from django import forms +import re +#from django.contrib.auth.models import User +from django.core.exceptions import ObjectDoesNotExist +#from django.contrib.comments.models import Comments + +from formation.models import * + + +typediplome = ( + (u'DN', u"Diplôme National"), + (u'DS', u'Diplôme de structure de la structure d\'accueil'), + (u'CE', u'Cerficat'), +) + +delivre_par = ( + (u'DS', u"Diplôme de la Structure d'accueil"), + (u'DO', u'Diplôme d\'un organisme partenaire'), + (u'CD', u'Codiplôme'), + (u'DD', u'Double diplôme'), +) + +t_formation = ( + (u'1', u"Ouverte à distance"), + (u'2', u"Uniquement en présentiel"), + (u'3', u"Mixte"), +) + +genre = ( + (u'M', u"Mademoiselle"), + (u'F', u"Madame"), + (u'F', u"Monsieur"), + ) +niveau_dpl = ( + (u'MI', u"Maîtrise"), + (u'MA', u"Master"), + (u'MG', u"Magistère"), + (u'DE', u"DESS"), + (u'DI', u"Diplôme d'Ingenieur"), + (u'DO', u"Doctorat"), + (u'DP', u"PhD"), + ) + + +class FormationClient(forms.Form): + """"Une formation est dispensé par un étblissement, concerne un domaine et a un niveau (type de formation) + Une formation se fait en présentiel, à distance ou combine les deux modes et pendant une durée précise. + """ + + + #domaine = models.CharField(max_length=256, label='Domaine de la formation') + #diplome = models.CharField(max_length=256, label='Dipplôme') + + #Identification de la formation + intitule = forms.CharField(max_length=512, label='Intitulé de la formation') + sigle = forms.CharField(max_length=32, label='Sigle de la formation', required=False) + traduction = forms.CharField(max_length=512, label='Traduction en français', required=True) + type_diplome = forms.ChoiceField(niveau_dpl, label='Type de diplôme') + discipline_auf = forms.CharField(max_length=255, label='Disciple(s) AUF', help_text='Si plusieurs, séparez par les points virgules') + niveau_entree = forms.CharField(max_length=128, label='Niveau d\'entrée', help_text='Formulez-le en nombre d\'années d\'étude dans l\'enseignement supérieur') + niveau_sortie = forms.CharField(max_length=128, label='Niveau de sortie', help_text='Formulez-le en nombre d\'années d\'étude dans l\'enseignement supérieur') + homologation = forms.ChoiceField(delivre_par, label='Délivrance du diplôme') + delivrance = forms.ChoiceField(delivre_par, label='Délivrance du diplôme') + vocation = forms.CharField(max_length=128, help_text='Saisir professionnelle et/ou recherche') + debouches = forms.TextInput(attrs={'size': 64}) + url = forms.URLField(max_length=128, label='Lien Internet de la formation', required=False) + + #Etablissement(s) + etablissement = forms.CharField(max_length=256, label='Structure d\'accueil', help_text='Format: Nom_Etablissement(SIGLE)') + composante = forms.CharField(max_length=256, label='Composante', help_text='Format: Nom_Composante(SIGLE)', required=False) + pays = forms.CharField(max_length=256, label='Pays') + ville = forms.CharField(max_length=256, label='Ville') + url_comp = forms.CharField(max_length=256, label='Lien Internet', required=False) + partenaire_mbre = forms.CharField(max_length=512, label='Etablisements partenaires membre', help_text='Entrez la liste séparée par un point virgule', required=False) + partenaire = forms.CharField(max_length=512, label='Autres partenaires', help_text='Entrez la lisete séparée par un point virgule', required=False) + + #Organisation de la formation + presentation = forms.forms.TextInput(attrs={'size': 64}) + duree = forms.CharField(max_length=128, label='Durée de la formation') + type_formation = forms.ChoiceField(t_formation) + langue = forms.CharField(max_length=64, label='Langue\(s\) d\'enseignement', help_text='Si plusieurs, séparez par le point virgule') + admision = forms.CharField(max_length=256, required=False) + cout = forms.FloatField(label='Coût de la formation', required=False) + respo = forms.CharField(max_length=255, label='Responsable de la formation', required=False) + co_respo = forms.CharField(max_length=255, label='Co-responsable', required=False) + date_saisie = forms.DateField() diff --git a/projets/cartographie/carto/formation/models.py b/projets/cartographie/carto/formation/models.py new file mode 100644 index 0000000..e363c5c --- /dev/null +++ b/projets/cartographie/carto/formation/models.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -* + +# Create your models here. +from django.db import models + +typediplome = ( + (u'DN', u"Diplôme National"), + (u'DS', u'Diplôme de structure de la structure d\'accueil'), + (u'CE', u'Cerficat'), +) + +delivre_par = ( + (u'DS', u"Diplôme de la Structure d'accueil"), + (u'DO', u'Diplôme d\'un organisme partenaire'), + (u'CD', u'Codiplôme'), + (u'DD', u'Double diplôme'), +) + +t_formation = ( + (u'1', u"Ouverte à distance"), + (u'2', u"Uniquement en présentiel"), + (u'3', u"Mixte"), +) + +genre = ( + (u'M', u"Mademoiselle"), + (u'F', u"Madame"), + (u'F', u"Monsieur"), + ) +niveau_dpl = ( + (u'MI', u"Maîtrise"), + (u'MA', u"Master"), + (u'MG', u"Magistère"), + (u'DE', u"DESS"), + (u'DI', u"Diplôme d'Ingenieur"), + (u'DO', u"Doctorat"), + (u'DP', u"PhD"), + ) + + +class Formation(models.Model): + """"Une formation est dispensé par un étblissement, concerne un domaine et a un niveau (type de formation) + Une formation se fait en présentiel, à distance ou combine les deux modes et pendant une durée précise. + """ + + + #domaine = models.CharField(max_length=256, verbose_name='Domaine de la formation') + #diplome = models.CharField(max_length=256, verbose_name='Dipplôme') + + #Identification de la formation + intitule = models.CharField(max_length=512, verbose_name='Intitulé de la formation') + sigle = models.CharField(max_length=32, verbose_name='Sigle de la formation', null=True, blank=True) + traduction = models.CharField(max_length=512, verbose_name='Traduction en français', null=True, blank=True) + type_diplome = models.CharField(max_length=255, choices=niveau_dpl, verbose_name='Type de diplôme') + discipline_auf = models.CharField(max_length=255, verbose_name='Disciple(s) AUF', help_text='Si plusieurs, séparez par les points virgules') + niveau_entree = models.CharField(max_length=128, verbose_name='Niveau d\'entrée', help_text='Formulez-le en nombre d\'années d\'étude dans l\'enseignement supérieur') + niveau_sortie = models.CharField(max_length=128, verbose_name='Niveau de sortie', help_text='Formulez-le en nombre d\'années d\'étude dans l\'enseignement supérieur') + homologation = models.CharField(max_length=255, choices=typediplome, verbose_name='Homologation') + delivrance = models.CharField(max_length=255, choices=delivre_par, verbose_name='Délivrance du diplôme') + vocation = models.CharField(max_length=128, help_text='Saisir professionnelle et/ou recherche', blank=True) + debouches = models.TextField(null=True, blank=True) + url = models.URLField(max_length=128, verbose_name='Lien Internet de la formation', null=True, blank=True) + + #Etablissement(s) + etablissement = models.CharField(max_length=256, verbose_name='Structure d\'accueil', help_text='Format: Nom_Etablissement(SIGLE)') + #sigle_etab = models.CharField(max_length=32, verbose_name='Sigle de l\'établisement', null=True) + composante = models.CharField(max_length=256, verbose_name='Composante', help_text='Format: Nom_Composante(SIGLE)', null=True, blank=True) + #sigle_comp = models.CharField(max_length=32, verbose_name='Sigle de la composante', null=True) + pays = models.CharField(max_length=256, verbose_name='Pays') + ville = models.CharField(max_length=256, verbose_name='Ville') + url_comp = models.CharField(max_length=256, verbose_name='Lien Internet', null=True, blank=True) + #partenaire_mbre = models.CharField(max_length=512, verbose_name='Etablisements partenaires membre', help_text='Entrez la liste séparée par un point virgule', null=True) + #partenaire = models.CharField(max_length=512, verbose_name='Autres partenaires', help_text='Entrez la lisete séparée par un point virgule', null=True) + + #Organisation de la formation + presentation = models.TextField(null=True, blank=True) + duree = models.CharField(max_length=128, verbose_name='Durée de la formation', blank=True) + type_formation = models.CharField(max_length=64, choices=t_formation, blank=True) + langue = models.CharField(max_length=64, verbose_name='Langue(s) d\'enseignement', help_text='Si plusieurs, séparez par le point virgule') + admision = models.CharField(max_length=256, null=True, blank=True) + cout = models.FloatField(verbose_name='Coût de la formation', null=True, blank=True) + respo = models.CharField(max_length=255, verbose_name='Responsable de la formation', null=True, blank=True) + co_respo = models.CharField(max_length=255, verbose_name='Co-responsable', null=True, blank=True) + date_saisie = models.DateField(auto_now=True, blank=True) + + # meta + actif = models.BooleanField() + class Meta: + db_table = u'ref_formation' + #ordering = ['diplome'] + verbose_name = u"Formation" + verbose_name_plural = u"Formations" + #order_with_respect_to = 'structure' + + + def __unicode__(self): + return "%s %s [%s]" % (self.intitule, self.sigle, self.etablissement) + + +statut = ( + (u'O', u"Oui"), + (u'N', u"Non"), + ) + +class Partenaire(models.Model): + formation = models.ForeignKey(Formation) + nom_partner = models.CharField(max_length=512, verbose_name='Structure partenaire', blank=True) + sigle_partner = models.CharField(max_length=32, verbose_name='sigle', null=True, blank=True) + ville_partner = models.CharField(max_length=64, verbose_name='ville', null=True, blank=True) + pays_partner = models.CharField(max_length=62, verbose_name='Pays', blank=True) + statut_membre = models.CharField(max_length=64, choices=statut, verbose_name='Membre de l\'AUF?', blank=True) + + def __unicode__(self): + return "%s %s [%s]" % (self.nom_partner, self.sigle_partner, self.ville_partner) + + + + + diff --git a/projets/cartographie/carto/formation/tests.py b/projets/cartographie/carto/formation/tests.py new file mode 100644 index 0000000..2247054 --- /dev/null +++ b/projets/cartographie/carto/formation/tests.py @@ -0,0 +1,23 @@ +""" +This file demonstrates two different styles of tests (one doctest and one +unittest). These will both pass when you run "manage.py test". + +Replace these with more appropriate tests for your application. +""" + +from django.test import TestCase + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.failUnlessEqual(1 + 1, 2) + +__test__ = {"doctest": """ +Another way to test that 1 + 1 is equal to 2. + +>>> 1 + 1 == 2 +True +"""} + diff --git a/projets/cartographie/carto/formation/views.py b/projets/cartographie/carto/formation/views.py new file mode 100644 index 0000000..df528cd --- /dev/null +++ b/projets/cartographie/carto/formation/views.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -* + +# Create your views here. +from django.template import Context +from django.template.loader import get_template +from django.http import HttpResponse, Http404 +#from django.contrib.auth.models import User +from django.shortcuts import render_to_response, get_object_or_404 +from django.http import HttpResponseRedirect +#from django.contrib.auth import logout +from django.template import RequestContext +from formation.forms import * +from formation.models import * + +import xml.etree.ElementTree as ET + + +from django.contrib.auth.decorators import login_required +from django.core.exceptions import ObjectDoesNotExist +#from django.contrib.auth.models import User +from datetime import datetime, timedelta +from django.contrib import admin + +def form_formation(request): + form = FormationClient() + variables = RequestContext(request, { + 'form': form + }) + return render_to_response('saisie/form_formation.html', variables) + +#def form_formation_xml(request): +# form = FormationClient() +# variables = RequestContext(request, { +# 'form': form +# }) +# return render_to_response('saisie/form_formation.html', variables) + + +def main_page(request): + formations = Formation.objects.all() + variables = RequestContext(request, { + 'formations': formations + }) + return render_to_response('main_page.html', variables) + + +def export_xml(request, formation_id): + formations = Formation.objects.get(id=formation_id) + partenaire = Partenaire.objects.filter(formation=formation_id) + variables = RequestContext(request, { + 'formations': formations, + 'partenaire': partenaire + }) + #return render_to_response('saisie/formation.xml', variables, mimetype="application/xml") + response = render_to_response('formation.xml', variables, mimetype="application/xml") + response['Content-Disposition'] = 'attachment; filename=formation.xml' + return response diff --git a/projets/cartographie/carto/manage.py b/projets/cartographie/carto/manage.py new file mode 100755 index 0000000..bcdd55e --- /dev/null +++ b/projets/cartographie/carto/manage.py @@ -0,0 +1,11 @@ +#!/usr/bin/python +from django.core.management import execute_manager +try: + import settings # Assumed to be in the same directory. +except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.exit(1) + +if __name__ == "__main__": + execute_manager(settings) diff --git a/projets/cartographie/carto/settings.py b/projets/cartographie/carto/settings.py new file mode 100644 index 0000000..3c50462 --- /dev/null +++ b/projets/cartographie/carto/settings.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -* +# Django settings for carto project. + +import os.path +#from conf import * + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + # ('Your Name', 'your_email@domain.com'), +) + +MANAGERS = ADMINS + +DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. +DATABASE_NAME = 'carto' # Or path to database file if using sqlite3. +DATABASE_USER = '' # Not used with sqlite3. +DATABASE_PASSWORD = '' # Not used with sqlite3. +DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. +DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'America/Chicago' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = '' + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash if there is a path component (optional in other cases). +# Examples: "http://media.lawrence.com", "http://example.com/media/" +MEDIA_URL = '' + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = '/media/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = 'eyi%ni!z(q)sx*k+jvs3)62l6j91tnq^&6b-s160+hxeuz*7)v' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.load_template_source', + 'django.template.loaders.app_directories.load_template_source', +# 'django.template.loaders.eggs.load_template_source', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', +) + +ROOT_URLCONF = 'carto.urls' + +TEMPLATE_DIRS = ( + os.path.join(os.path.dirname(__file__), 'template'), + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.admin', + 'carto.formation' +) diff --git a/projets/cartographie/carto/template/base.html b/projets/cartographie/carto/template/base.html new file mode 100644 index 0000000..3507f44 --- /dev/null +++ b/projets/cartographie/carto/template/base.html @@ -0,0 +1,15 @@ + + + + Cartographie | + {% block title %}{% endblock %} + + + + {% block external %}{% endblock %} + +

{% block head %}{% endblock %}

+ {% block content %}{% endblock %} + + \ No newline at end of file diff --git a/projets/cartographie/carto/template/formation.xml b/projets/cartographie/carto/template/formation.xml new file mode 100644 index 0000000..75de27c --- /dev/null +++ b/projets/cartographie/carto/template/formation.xml @@ -0,0 +1,99 @@ + + +{% if formations %} + + + + {{ formations.etablissement }} + + {{ formations.sigle }} + + + + {{ formations.ville }} + {{ formations.pays }} + + + + + + {{ formations.composante }} + + {{ formations.sigle }} + + + + {{ formations.url }} + + + + + + +{% if partenaire %} + {% for partenaires in partenaire %} + + + {{ partenaires.nom_partner }} + + {{ partenaires.sigle_partner }} + + + + {{ partenaires.ville_partner }} + {{ partenaires.pays_partner }} + + + + + {% endfor %} +{% endif %} + + + + {{ formations.intitule }} {{ formations.sigle }} + + + {{ formations.presentation }} + + + + {{ formations.type_diplome }} + {{ formations.niveau_sortie }} + + {{ formations.niveau_sortie }} + + + {{ formations.admision }} coût: {{ formations.cout }} + + + {{ formations.type_formation }} + + {{ formations.duree }} + + + + + {{ formations.respo }} + + + + + + + {{ formations.respo }} + {{ formations.langue }} + {{ formations.homologation }} + {{ formations.delivrance }} + {{ formations.vocation }} + {{ formations.date_saisie }} + + + + + + + +{% endif %} \ No newline at end of file diff --git a/projets/cartographie/carto/template/main_page.html b/projets/cartographie/carto/template/main_page.html new file mode 100644 index 0000000..04008bf --- /dev/null +++ b/projets/cartographie/carto/template/main_page.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} + +{% block title %}Bienvenue{% endblock %} + +{% block head %}Cartographie des établissements memebre de l'AUF{% endblock %} + +{% block content %} + {% if formations %} +
    + {% for formation in formations %} +
  • {{ formation.intitule }}
  • + fichier xml + {% endfor %} +
+ {% else %} +

Pas encore de formation enregistrés

+{% endif %} + +{% endblock %} \ No newline at end of file diff --git a/projets/cartographie/carto/template/saisie/apres_saisie.html b/projets/cartographie/carto/template/saisie/apres_saisie.html new file mode 100644 index 0000000..a2c2cf7 --- /dev/null +++ b/projets/cartographie/carto/template/saisie/apres_saisie.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} +{% block title %}Registration Successful{% endblock %} +{% block head %} +Registration Completed Successfully +{% endblock %} +{% block content %} +Thank you for registering. Your information has been +saved in the database. Now you can either +login or go back to the +main page. +{% endblock %} diff --git a/projets/cartographie/carto/template/saisie/form_formation.html b/projets/cartographie/carto/template/saisie/form_formation.html new file mode 100755 index 0000000..2c06b93 --- /dev/null +++ b/projets/cartographie/carto/template/saisie/form_formation.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block title %}Bienvenue{% endblock %} + +{% block head %}Cartographie des établissements memebre de l'AUF{% endblock %} + +{% block content %} +
+ {{ form.as_p }} + +
+{% endblock %} diff --git a/projets/cartographie/carto/urls.py b/projets/cartographie/carto/urls.py new file mode 100644 index 0000000..d348730 --- /dev/null +++ b/projets/cartographie/carto/urls.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -* + +from django.conf.urls.defaults import * +from django.views.generic.simple import direct_to_template +from formation.views import * +import django.contrib.auth + +# Uncomment the next two lines to enable the admin: +from django.contrib import admin +admin.autodiscover() + +urlpatterns = patterns('', + # Example: + + (r'^$', main_page), + (r'^saisie/$', form_formation), + (r'^saisie/(\w+)/$', export_xml), + #(r'^saisie/success/$', direct_to_template, { 'template': 'saisie/form_formation.html' }), + + # (r'^carto/', include('carto.foo.urls')), + + # Uncomment the admin/doc line below and add 'django.contrib.admindocs' + # to INSTALLED_APPS to enable admin documentation: + # (r'^admin/doc/', include('django.contrib.admindocs.urls')), + + # Uncomment the next line to enable the admin: + (r'^admin/', include(admin.site.urls)), +) -- 1.7.10.4