reports.py 8.28 KB
Newer Older
1 2 3 4
""" reports

    Create examples for list.
    Create examples for metric.
5

6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
"""
#------------------------------------------------------------------------------
#
# Renderers for Lists
# Define how the publication fields are displayed
#
#------------------------------------------------------------------------------
if db(db.renderers).count() == 0:
    db.renderers.insert(id=2,
                        renderer=T('Article'),
                        template="{publications.title}, {publications.first_author} "
                                 "<span style='font-style: italic;'>et al.</span>, "
                                 "{collaborations.collaboration}, "
                                 "{publishers.abbreviation} "
                                 "{publications.volume} ({publications.year}) "
                                 "{publications.pages}",
                        postprocessing='remove_undef',
                        definition=T('Articles published'))

    db.renderers.insert(id=3,
                        renderer=T('Conference'),
                        template="{publications.title}, {publications.authors}, "
                                 "{publications.conference_title}, "
                                 "{publications.conference_town}, "
                                 "{countries.country}, "
                                 "{publications.conference_dates}",
LE GAC Renaud's avatar
LE GAC Renaud committed
32
                        postprocessing='highlight_my_speaker',
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
                        definition=T('Talks or proceedings'))

    db.renderers.insert(id=4,
                        renderer=T('Preprint'),
                        template="{publications.title}, {publications.first_author} "
                                 "<span style='font-style: italic;'>et al.</span>, "
                                 "{collaborations.collaboration}, "
                                 "{publications.preprint}",
                        postprocessing='remove_undef',
                        definition=T('Articles deposited in arXiv not yet published'))

    db.renderers.insert(id=5,
                        renderer=T('Report'),
                        template="{publications.title}, {publications.authors}, "
                                 "{publications.report_numbers}",
LE GAC Renaud's avatar
LE GAC Renaud committed
48
                        postprocessing='highlight_my_authors',
49 50 51 52 53 54
                        definition=T('Reports or notes signed by members of the institute'))

    db.renderers.insert(id=6,
                        renderer=T('Report by collaboration'),
                        template="{publications.title}, {publications.first_author} "
                                 "<span style='font-style: italic;'>et al.</span>, "
55
                                 "{collaborations.collaboration}, "
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
                                 "{publications.report_numbers}",
                        postprocessing='',
                        definition=T('Reports or notes signed by collaboration(s)'))

    db.renderers.insert(id=7,
                        renderer=T('Thesis'),
                        template="{publications.title}, {publications.authors}, "
                                 "{publications.universities}, {publications.defense}",
                        postprocessing='',
                        definition='PhD Thesis, ...')

#------------------------------------------------------------------------------
#
# Sections for Lists
# Define the relation between the publication category and the renderers
#
#------------------------------------------------------------------------------
if db(db.sections).count() == 0:
    db.sections.insert(id=1,
                       section=T('Articles'),
                       id_renderers=2,
                       category_codes='ACL, ACLN',
                       conditions='',
                       sort_field='submitted',
                       definition='')

    db.sections.insert(id=2,
                       section=T('Preprints'),
                       id_renderers=4,
                       category_codes='PRE',
                       conditions='',
                       sort_field='preprint',
                       definition='')

    db.sections.insert(id=3,
                       section=T('Proceedings'),
                       id_renderers=3,
                       category_codes='ACTI, ACTN',
                       conditions='',
                       sort_field='submitted',
                       definition='')

    db.sections.insert(id=4,
                       section=T('Talks'),
                       id_renderers=3,
                       category_codes='COM',
                       conditions='',
                       sort_field='submitted',
                       definition='')

    db.sections.insert(id=5,
                       section=T('Posters'),
                       id_renderers=3,
                       category_codes='AFF',
                       conditions='',
                       sort_field='submitted',
                       definition='')

    db.sections.insert(id=6,
                       section=T('Reports'),
                       id_renderers=5,
                       category_codes='AP',
                       conditions='id_collaborations < 2',
                       sort_field='submitted',
                       definition='')

    db.sections.insert(id=7,
                       section=T('Reports by collaboration'),
                       id_renderers=6,
                       category_codes='AP',
                       conditions='id_collaborations > 1',
                       sort_field='submitted',
                       definition='')

    db.sections.insert(id=8,
                       section=T('Theses'),
                       id_renderers=7,
                       category_codes='PHD, HDR',
                       conditions='',
                       sort_field='submitted',
                       definition='')

#------------------------------------------------------------------------------
#
# lists
# A series of sections with  grouping criteria
#
#------------------------------------------------------------------------------
if db(db.lists).count() == 0:
145 146 147

    sections = [T('Preprints'),
                T('Articles'),
148 149
                T('Proceedings'),
                T('Talks'),
150
                T('Posters'),
151 152 153
                T('Reports'),
                T('Reports by collaboration'),
                T('Theses')]
154

155 156 157
    db.lists.insert(id=2,
                    list=T('cat. usual / team / year'),
                    sections=', '.join(sections),
158 159 160 161 162 163 164
                    axis_level_1='categories',
                    axis_level_2='teams',
                    axis_level_3='publications',
                    granularity_level_1='usual',
                    granularity_level_2='team',
                    granularity_level_3='year',
                    direction_level_3='DESC',
165 166 167 168 169
                    definition=T('List shorted by usual category, by team and by year'))

    db.lists.insert(id=3,
                    list=T('cat. AERES / project / year'),
                    sections=', '.join(sections),
170 171 172 173 174 175 176
                    axis_level_1='categories',
                    axis_level_2='teams',
                    axis_level_3='publications',
                    granularity_level_1='code',
                    granularity_level_2='team',
                    granularity_level_3='year',
                    direction_level_3='DESC',
177 178 179 180 181 182 183 184
                    definition=T('List shorted by AERES category, by project and by year'))

#------------------------------------------------------------------------------
#
# Metrics
#
#------------------------------------------------------------------------------
if db(db.metrics).count() == 0:
185

186 187
    db.metrics.insert(id=2,
                      metric=T('cat. usual / year'),
188 189 190 191
                      axis_column='categories',
                      axis_row='publications',
                      granularity_column='usual',
                      granularity_row='year',
192 193 194 195
                      definition=T('Count publications by usual category and by year'))

    db.metrics.insert(id=3,
                      metric=T('cat. AERES / year'),
196 197 198 199
                      axis_column='categories',
                      axis_row='publications',
                      granularity_column='code',
                      granularity_row='year',
200
                      definition=T('Count publications by AERES category and by year'))