manager date range dans admin + employe UT
[auf_rh_dae.git] / project / settings.py
1 # -*- encoding: utf-8 -*-
2
3 import os
4 import socket
5 from project.conf import * # NOQA
6
7 PROJET_TITRE = "Ressources humaines"
8
9 # Rapports d'erreurs
10 SERVER_EMAIL = 'ne-pas-repondre@auf.org'
11 EMAIL_SUBJECT_PREFIX = '[auf_rh_dae - %s] ' % socket.gethostname()
12 ADMINS = (
13 ('Équipe ARI-SI', 'developpeurs@ca.auf.org'),
14 )
15
16 MANAGERS = ADMINS
17
18 TIME_ZONE = 'America/Montreal'
19 LANGUAGE_CODE = 'fr'
20 FORMAT_MODULE_PATH = 'project.formats'
21 USE_L10N = True
22 USE_THOUSAND_SEPARATOR = False
23 DATE_FORMAT = 'd-m-Y'
24 DATE_INPUT_FORMATS = ('%d-%m-%Y', )
25
26 SESSION_SAVE_EVERY_REQUEST = True
27 SESSION_EXPIRE_AT_BROWSER_CLOSE = True
28
29 # Absolute path to the directory that holds media.
30 # Example: "/home/media/media.lawrence.com/"
31 MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media')
32 PRIVE_MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media_prive')
33
34 STATICFILES_DIRS = (
35 os.path.join(os.path.dirname(__file__), 'assets'),
36 )
37 STATIC_ROOT = os.path.join(os.path.dirname(__file__), 'static')
38 STATIC_URL = '/static/'
39
40 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
41 # trailing slash if there is a path component (optional in other cases).
42 # Examples: "http://media.lawrence.com", "http://example.com/media/"
43 MEDIA_URL = '/media/'
44 PRIVE_MEDIA_URL = '/prive/'
45 OE_PRIVE_MEDIA_URL = '/recrutement/prive/'
46
47 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
48 # trailing slash.
49 # Examples: "http://foo.com/media/", "/media/".
50 #ADMIN_MEDIA_PREFIX = '/media/django/'
51
52 # Don't share this with anybody.
53 SECRET_KEY = '^2w#%abp_d+e#(7f5w$leef50)c@4y38cnn#ccji@84$2^rt#l'
54
55 MIDDLEWARE_CLASSES = (
56 'django.middleware.common.CommonMiddleware',
57 'django.contrib.sessions.middleware.SessionMiddleware',
58 'django.contrib.messages.middleware.MessageMiddleware',
59 'django.contrib.auth.middleware.AuthenticationMiddleware',
60 'django.middleware.doc.XViewMiddleware',
61 'reversion.middleware.RevisionMiddleware',
62 )
63
64 ROOT_URLCONF = 'project.urls'
65
66 INSTALLED_APPS = (
67 'auf.django.skin',
68 'auf.django.references',
69 'auf.django.emploi',
70 'auf.django.admingroup',
71 'auf.django.workflow',
72 'auf.django.permissions',
73 'auf.django.emploi',
74 'admin_tools',
75 'admin_tools.theming',
76 'admin_tools.menu',
77 'admin_tools.dashboard',
78 'django.contrib.admin',
79 'django.contrib.auth',
80 'django.contrib.contenttypes',
81 'django.contrib.humanize',
82 'django.contrib.messages',
83 'django.contrib.sessions',
84 'django.contrib.staticfiles',
85 'django_qbe',
86 'ajax_select',
87 'south',
88 'reversion',
89 'alphafilter',
90 'form_utils',
91 'tinymce',
92 'captcha',
93 'project.rh',
94 'project.dae',
95 'project.recrutement',
96 )
97
98 TEMPLATE_CONTEXT_PROCESSORS = (
99 'django.contrib.auth.context_processors.auth',
100 'django.core.context_processors.debug',
101 'django.core.context_processors.i18n',
102 'django.core.context_processors.media',
103 'django.core.context_processors.static',
104 'django.contrib.messages.context_processors.messages',
105 'django.core.context_processors.request',
106 'auf.django.skin.context_processors.auf',
107 'project.dae.context_processors.user_in_dae_groupes',
108 )
109
110 AUTHENTICATION_BACKENDS = (
111 'auf.django.auth.backends.CascadeBackend',
112 'auf.django.permissions.backends.AuthenticationBackend',
113 )
114 LOGIN_URL = "/connexion"
115 LOGIN_REDIRECT_URL = "/"
116
117 TEMPLATE_DIRS = (
118 os.path.join(os.path.dirname(__file__), "templates"),
119 )
120
121
122 ADMIN_TOOLS_INDEX_DASHBOARD = 'project.dashboard.CustomIndexDashboard'
123 ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'project.dashboard.CustomAppIndexDashboard'
124 ADMIN_TOOLS_MENU = 'project.menu.CustomMenu'
125
126 AJAX_LOOKUP_CHANNELS = {
127 'responsables': ('project.dae.catalogues', 'Responsable'),
128 'dossiers': ('project.dae.catalogues', 'Dossier'),
129 'dae_postes': ('project.dae.catalogues', 'Poste'),
130 'pays': ('project.rh.catalogues', 'Pays'),
131 'implantations': ('project.rh.catalogues', 'Implantation'),
132 'typepostes': ('project.rh.catalogues', 'TypePoste'),
133 'postes': ('project.rh.catalogues', 'Poste'),
134 'valeurpoints': ('project.rh.catalogues', 'ValeurPoint'),
135 'employes': ('project.rh.catalogues', 'Employe'),
136 'dossiers': ('project.rh.catalogues', 'Dossier'),
137 }
138 AJAX_SELECT_INLINES = 'inline'
139
140
141 TINYMCE_DEFAULT_CONFIG = {
142 'theme': "advanced",
143 'plugins': "paste",
144 'theme_advanced_buttons1': (
145 "bold,italic,underline,|,formatselect,|,bullist,numlist,|,undo,redo,|,"
146 "link,unlink"
147 ),
148 'theme_advanced_buttons2': "",
149 'theme_advanced_buttons3': "",
150 'theme_advanced_statusbar_location': "bottom",
151 'theme_advanced_toolbar_align': "left",
152 'theme_advanced_styles': "Titre=titre;Sous-titre=sous-titre;Normal=normal",
153 'width': "800",
154 'height': "200",
155 'theme_advanced_resizing': "true",
156 'custom_undo_redo_levels': 10,
157 'theme_advanced_toolbar_location': 'top',
158 'inline_styles': 'false',
159 'paste_use_dialog': 'false',
160 'paste_auto_cleanup_on_paste': 'true',
161 'paste_convert_headers_to_strong': 'false',
162 'paste_strip_class_attributes': 'all',
163 'paste_remove_spans': 'true',
164 'paste_remove_styles': 'true',
165 'content_css': '/media/css/tinymce.css',
166 }
167
168 # django-sendfile
169 SENDFILE_BACKEND = 'sendfile.backends.simple'
170
171 QBE_DISPLAY_DATABASES = False
172
173 # Il est *très* important de respecter la case.
174 QBE_CUSTOM_MODELS = {'Rh': {
175 'Employe': {},
176 'Poste': {},
177 'Dossier': {},
178 'Remuneration': {},
179 'Contrat': {},
180 }}
181
182 QBE_ALLOWED_FIELDS = {'Rh': {
183 'Employe': [
184 'nom', 'prenom', 'genre', 'date_naissance', 'situation_familiale',
185 'date_entree'
186 ],
187 'Poste': ['nom', 'date_debut', 'date_fin'],
188 'Dossier': [
189 'statut_residence', 'regime_travail',
190 'regime_travail_nb_heure_semaine', 'date_debut', 'date_fin'
191 ],
192 'Remuneration': ['montant', 'date_debut', 'date_fin'],
193 'Contrat': ['date_debut', 'date_fin'],
194 }}
195
196 SOUTH_TESTS_MIGRATE = False