From 6ef8ead441ecdcb2b66f7d9f0071ae7a7838a89e Mon Sep 17 00:00:00 2001 From: Cyril Robert Date: Wed, 3 Mar 2010 16:11:38 -0500 Subject: [PATCH] Finalisation +roa +admin --- auf_savoirs_en_partage_django/savoirs/admin.py | 8 ++++++++ auf_savoirs_en_partage_django/savoirs/models.py | 8 ++++++++ auf_savoirs_en_partage_django/settings.py | 18 +++++++++++++++++- buildout.cfg | 2 ++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 auf_savoirs_en_partage_django/savoirs/admin.py diff --git a/auf_savoirs_en_partage_django/savoirs/admin.py b/auf_savoirs_en_partage_django/savoirs/admin.py new file mode 100644 index 0000000..03350d3 --- /dev/null +++ b/auf_savoirs_en_partage_django/savoirs/admin.py @@ -0,0 +1,8 @@ +# -*- encoding: utf-8 -*- +from django.contrib import admin +from models import Actualite, Discipline + +admin.site.register (Actualite) +admin.site.register (Discipline) + + diff --git a/auf_savoirs_en_partage_django/savoirs/models.py b/auf_savoirs_en_partage_django/savoirs/models.py index f82c019..9b45d5d 100644 --- a/auf_savoirs_en_partage_django/savoirs/models.py +++ b/auf_savoirs_en_partage_django/savoirs/models.py @@ -4,6 +4,10 @@ from django.db import models class Discipline(models.Model): id = models.IntegerField(primary_key=True, db_column='id_discipline') nom = models.CharField(max_length=765, db_column='nom_discipline') + + def __unicode__ (self): + return "Discipline: %s" % self.nom + class Meta: db_table = u'discipline' ordering = ["nom",] @@ -17,6 +21,10 @@ class Actualite(models.Model): date = models.DateField(db_column='date_actualite') visible = models.CharField(max_length=3, db_column='visible_actualite') ancienid = models.IntegerField(db_column='ancienId_actualite') # Field name made lowercase. + + def __unicode__ (self): + return "Actualite %d: %s" % (self.id, self.titre) + class Meta: db_table = u'actualite' ordering = ["-date",] diff --git a/auf_savoirs_en_partage_django/settings.py b/auf_savoirs_en_partage_django/settings.py index e8e509e..048190d 100644 --- a/auf_savoirs_en_partage_django/settings.py +++ b/auf_savoirs_en_partage_django/settings.py @@ -44,6 +44,8 @@ INSTALLED_APPS = ( 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.admin', + 'django_roa', + 'auf_roa_authentification_backend', 'savoirs', ) @@ -56,4 +58,18 @@ TEMPLATE_DIRS = ( os.path.join(os.path.dirname(__file__), "templates"), ) - +AUTHENTICATION_BACKENDS = ( + 'auf_roa_authentification_backend.backends.CascadeBackend', +) +AUTH_PASSWORD_REQUIRED=True +ROA_MODELS = True # set to False if you'd like to develop/test locally +ROA_FORMAT = 'django' +ROA_HEADERS = { + 'Content-Type': 'application/x-www-form-urlencoded', +} +ROA_DJANGO_ERRORS = True # useful to ease debugging if you use test server + +ROA_BASE_URL = 'https://authentification.auf.org/auth/' +SERIALIZATION_MODULES = { + 'django' : 'auf_roa_authentification_backend.serializers', +} diff --git a/buildout.cfg b/buildout.cfg index 6a3066d..9137342 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -1,6 +1,7 @@ [buildout] parts = django find-links = http://pypi.auf.org/auf_savoirs_en_partage_backend/ + http://pypi.auf.org/auf_roa_authentification_backend/ [django] recipe = djangorecipe @@ -10,3 +11,4 @@ wsgi = true settings = production extra-paths = auf_savoirs_en_partage_django eggs = auf_savoirs_en_partage_backend + auf_roa_authentification_backend -- 1.7.10.4