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

Update RecordThesis to work with attirbute df_authors

parent c6872f3b
...@@ -35,7 +35,7 @@ class RecordThesis(RecordPubli): ...@@ -35,7 +35,7 @@ class RecordThesis(RecordPubli):
""" """
# for a thesis, the authors field contains names of author # for a thesis, the authors field contains names of author
# as well as those of directors. The latter have to be removed. # as well as those of directors. The latter have to be removed.
df = self[u"authors"] df = self.df_authors
if "relator_name" in df: if "relator_name" in df:
df = df[df.relator_name != THESIS_DIR] df = df[df.relator_name != THESIS_DIR]
...@@ -60,46 +60,46 @@ class RecordThesis(RecordPubli): ...@@ -60,46 +60,46 @@ class RecordThesis(RecordPubli):
"""The defence date for a master/phd thesis. """The defence date for a master/phd thesis.
Returns: Returns:
unicode: str:
* The pattern is not standardise * The pattern is not standardise
and can varies between records and between stores. and can varies between records and between stores.
* The filter CLEAN_THESIS_DEFENSE is applied. * The filter CLEAN_THESIS_DEFENSE is applied.
""" """
val = self._get(u"dissertation_note", u"defense_date") val = self._get("dissertation_note", "defense_date")
return CLEAN_THESIS_DEFENSE(val) return CLEAN_THESIS_DEFENSE(val)
def these_level(self): def these_level(self):
"""The level of the thesis. """The level of the thesis.
Returns: Returns:
unicode: str:
* The value is ``master`` or ``PhD``. * The value is ``master`` or ``PhD``.
* The value is not standardise and can varies * The value is not standardise and can varies
between records and between stores. between records and between stores.
* Empty string when not defined * Empty string when not defined
""" """
return self._get(u"dissertation_note", u"diploma") return self._get("dissertation_note", "diploma")
def these_directors(self, sep=u", "): def these_directors(self, sep=", "):
"""The list of director(s) """The list of director(s)
Returns: Returns:
unicode: str:
* Names are separated by the ``sep`` argument. * Names are separated by the ``sep`` argument.
* Empty string when it is not defined. * Empty string when it is not defined.
""" """
# for a thesis, the author field 700 field contains # for a thesis, the author field 700 field contains
# names of the director as well as the name of authors # names of the director as well as the name of authors
df = self[u"authors"] df = self.df_authors
if "relator_name" in df: if "relator_name" in df:
query = df.relator_name == THESIS_DIR query = df.relator_name == THESIS_DIR
df = df.loc[query] df = df.loc[query]
return (sep.join(df.fmt_name) if len(df) > 0 else u"") return (sep.join(df.fmt_name) if len(df) > 0 else "")
else: else:
return "" return ""
...@@ -108,9 +108,9 @@ class RecordThesis(RecordPubli): ...@@ -108,9 +108,9 @@ class RecordThesis(RecordPubli):
"""The university(ies) delivering the thesis diploma. """The university(ies) delivering the thesis diploma.
Returns: Returns:
unicode: str:
- empty when university(ies) is not defined - empty when university(ies) is not defined
- several university are separated by ``&`` character. - several university are separated by ``&`` character.
""" """
return self._get(u"dissertation_note", u"university") return self._get("dissertation_note", "university")
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