Commit b9eaf595 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Use the field argument represent.

parent 29334438
......@@ -10,6 +10,7 @@
'careers': 'carrières',
'categories': 'catégories',
'Category': 'Catégorie',
'Catégorie': 'Catégorie',
'CDD': 'CDD',
'Cdd': 'Cdd',
'Cdd Flag': 'Cdd Flag',
......@@ -69,6 +70,7 @@
'Max Records': 'Max Records',
'Model': 'Modèle',
'Name': 'Nom',
'Niveau': 'Niveau',
'Note': 'Note',
'Notified': 'Notifié',
'Organization': 'Organisation',
......
......@@ -62,8 +62,8 @@ db.define_table("agencies",
migrate="agencies.table")
db.define_table("categories",
Field("code", "string", notnull=True),
Field("usual", "string"),
Field("code", "string", notnull=True, label=T("Level")),
Field("usual", "string", label=T("Category")),
Field("definition", "text"),
migrate="categories.table")
......@@ -149,7 +149,9 @@ db.define_table("history",
Field("id_projects", db.projects, default=undef_id, label='Project'),
Field("id_categories", db.categories, default=undef_id, label='Category'),
Field("id_agencies", db.agencies, default=undef_id, label='Agency'),
Field("cdd_flag", "boolean", default=False, label="CDD"),
Field("cdd_flag", "boolean", default=False,
label="CDD",
represent=lambda flag, row: (CENTER('x') if flag else '')),
Field("start_date", "date", default=today, notnull=True),
Field("end_date", "date"),
Field("percentage", "integer", default=100),
......
......@@ -3,13 +3,6 @@
<br>
{{
# column with a better display of the CDD flag
cdd = {'label': 'CDD',
'class': '',
'content': lambda row, rc: (CENTER('x') if row.history.cdd_flag else ''),
'selected': False,
'width': ''}
# column with the period coverage
time_coverage = {'label': T('Coverage'),
'class': '',
......@@ -28,11 +21,11 @@
table = SQLTABLE(rows,
columns=['categories.usual',
'people.last_name',
'categories.code'],
headers={'categories.usual': T('Category'),
'people.last_name': T('Name'),
'categories.code': T('Level')},
extracolumns=[cdd, time_coverage, age],
'categories.code',
'history.cdd_flag',
'history.percentage'],
headers='labels',
extracolumns=[time_coverage, age],
renderstyle=True)
response.write(CENTER(table))
......
Markdown is supported
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