# -*- coding: utf-8 -*- """ publications """ tp_authors = \ T("List of authors separated by comma: J. Doe, P.-Y. Smith") tp_authors_institute = \ T("List of authors belonging to your institute, separated by comma: P.-Y. Doe, J. Smith") tp_conference_dates = \ T("Dates of the conference: 9-10 Oct 2012 or 29 Oct - 3 Nov 2012 or 3 Dec 2012") tp_conference_title = \ T("The title of the conference. Use the latex syntax for symbol: $\\alpha$") tp_conference_url = \ T("The URL of the conference: http://....") tp_directors = \ T("List of directors separated by comma: J. Doe, P.-Y. Smith") tp_defense = \ T("Date of defense: 13 Dec 2011") tp_first_author = \ T("The name of the first author: J. Doe") tp_origin = \ T("The URL of the associated record in cds or inspirehep: http://cds.cern.ch/record/1669557") tp_pages = \ T("Number for the first pages or a range 69-80") tp_preprint = \ T("Preprint identifier separated by comma: arXiv:0906.1516") tp_report_numbers = \ T("Report identifier separated by comma: LHCb-PROC-2008-04") tp_submitted = \ T("Date of submission to a publisher: 2011-12-13 or 2011-12") tp_speaker = \ T("The name of the speaker: P.-Y. Smith") tp_title = \ T("The title of the publication. Use the latex syntax for symbol: $\\alpha$") tp_universities = \ T("List of university separated by comma") tp_url = \ T("The URL pointing to the pdf file of the the publication (open access): http://arxiv.org/pdf/1103.2465") tp_volume = \ T("The volume number: 123 or 64-65") tp_year = \ T("Year of the publication") db.define_table("publications", Field("title", "text", comment=tp_title, notnull=True), Field("first_author", "string", length=255, comment=tp_first_author, notnull=True), Field("authors", "text", comment=tp_authors, notnull=True), Field("id_collaborations", "reference collaborations", default=undef_id, label="Collaboration"), Field("id_publishers", "reference publishers", default=undef_id, label="Revue"), Field("year", "integer", comment=tp_year, notnull=True), Field("volume", "string", length=255, comment=tp_volume, default=""), Field("pages", "string", length=255, comment=tp_pages, default=""), Field("submitted", "string", length=255, comment=tp_submitted, notnull=True), Field("preprint", "string", length=255, comment=tp_preprint, default=""), Field("publication_url", "string", length=255, comment=tp_url, default="", label="PDF file url"), Field("conference_title", "text", comment=tp_conference_title, default="", label='Title'), Field("conference_url", "string", length=255, comment=tp_conference_url, default="", label='url'), Field("conference_dates", "string", length=255, comment=tp_conference_dates, default="", label='Dates'), Field("conference_town", "string", length=255, default="", label='Town'), Field("id_countries", "reference countries", default=undef_id, label='Country'), Field("conference_speaker", "string", length=255, comment=tp_speaker, default="", label='Speaker'), Field("report_numbers", "string", length=255, comment=tp_report_numbers, default="", label="Number(s)"), Field("id_reports", "reference reports", default=undef_id, label="Type"), Field("universities", "string", length=255, comment=tp_universities, default=""), Field("directors", "string", length=255, comment=tp_directors, default=""), Field("defense", "string", length=255, comment=tp_defense, default=""), Field("book_isbn", "string", length=255, label="ISBN", default=""), Field("book_issn", "string", length=255, label="ISSN", default=""), Field("book_chapters", "string", length=255, default="", label="Chapter(s)"), Field("authors_institute", "text", comment=tp_authors_institute, notnull=True, label="Authors"), Field("id_authors_roles", "reference authors_roles", default=undef_id, label="Role"), Field("id_teams", "reference teams", label='Team', notnull=True), Field("id_projects", "reference projects", label='Project', notnull=True), Field("id_categories", "reference categories", default=undef_id, label='Category'), Field("id_status", "reference status", default=undef_id, label="Status"), Field("origin", "string", length=255, comment=tp_origin, writable=False), migrate="publications.table") db.publications._before_delete.append(INHIBIT_PUBLICATION_DELETE_ON_OK) db.publications._before_insert.append(INHIBIT_DUPLICATE_PUBLICATION) db.publications._before_update.append(INHIBIT_PUBLICATION_UPDATE_ON_OK) db.publications.authors.filter_in = dbui.CLEAN_COMMA db.publications.authors_institute.filter_in = dbui.CLEAN_COMMA db.publications.conference_title.filter_in = dbui.CLEAN_SPACES db.publications.conference_town.filter_in = dbui.CLEAN_SPACES db.publications.defense.filter_in = filters.CLEAN_THESIS_DEFENSE db.publications.first_author.filter_in = dbui.CLEAN_COMMA db.publications.title.filter_in = dbui.CLEAN_SPACES db.publications.authors.requires = IS_LENGTH(65535) # rule: 30 Dec 2012 db.publications.defense.requires = IS_EMPTY_OR(IS_MATCH(REG_DEFENSE)) db.publications.id_publishers.requires = IS_IN_DB(db, 'publishers.abbreviation') # rule: 10-14 Dec 2012 or 28 Jun - 4 Jul 2012 db.publications.conference_dates.requires = IS_EMPTY_OR(IS_MATCH(REG_CONF_DATES)) db.publications.conference_url.requires = IS_EMPTY_OR(IS_URL()) db.publications.origin.requires = IS_EMPTY_OR(IS_URL()) db.publications.publication_url.requires = IS_EMPTY_OR(IS_URL()) # rule: 2012-12 or 2012-12-31 db.publications.submitted.requires = IS_MATCH(REG_SUBMITTED) db.publications.year.requires = IS_INT_IN_RANGE(1900, year+1)