papers.models module

This module defines most of the models used in the platform.

  • Paper represents a (deduplicated) paper.

    The sources it has been discovered from are witnessed by two types of records:

    • OaiRecord instances are created by OAI-PMH sources, or metadata sources not originally in OAI-PMH but wrapped in this format by proaixy. They indicate the availability of the paper in repositories. They link to an OaiSource object that indicates what data source we have got this record from.

    Multiple OaiRecord can (and typically are) associated with a paper, when the metadata they contain yield the same paper fingerprint. These records are stored inside the Paper object in a JSON field.

  • Researcher represents a researcher profile (a physical person).

    This person has a cannonical Name, but can also be associated with other names through a NameVariant relation (indicating a confidence value for the association of the name with this reseracher).

  • Researchers can be organized into Department instances, which belong to an Institution.

class papers.models.Department(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A department in an institution. Each Researcher is affiliated with exactly one department. :param name: the full name of the department

Parameters:
  • id (AutoField) – Id
  • name (CharField) – Name
  • institution_id (ForeignKey) – Institution
  • stats_id (ForeignKey) – Stats
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

breadcrumbs()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

institution

The institution it belongs to

institution_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

The full name of the department

object_id

Criteria to use in the search view to filter on this department

objects = <django.db.models.manager.Manager object>
researcher_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

sorted_researchers

List of Researcher in this department sorted by last name (prefetches their stats as well)

stats

AccessStatistics about the papers authored in this department

stats_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

update_stats()[source]

Refreshes the department-level access statistics for that department.

url

The URL of the main page (list of researchers) for this department.

class papers.models.Institution(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A university or research institute.

Parameters:
  • id (AutoField) – Id
  • name (CharField) – Name
  • identifiers (ArrayField) – Identifiers
  • country (CountryField) – Country
  • coords (PointField) – Coords
  • stats_id (ForeignKey) – Stats
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

breadcrumbs()[source]
coords

Coordinates

country

Country code

classmethod create(dct)[source]

Given a dictionary representing an institution, as returned by OrcidProfile.institution, save the institution in the DB (or return an existing duplicate).

The dictionary should contain ‘name’ and ‘country’ values, and possibly an identifier (such as a Ringgold one).

Returns None if the institution is invalid (invalid country code, name too long…)

department_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_country_display(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

identifiers

A list of identifiers for the institution (eg: ringgold-2167 for MIT)

merge(i)[source]

Merges another institution into self

name

The full name of the institution

object_id

Criteria to use in the search view to filter on this department

objects = <django.db.models.manager.Manager object>
researcher_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

slug
sorted_departments

Departments belonging to this institution, sorted by name.

sorted_researchers

List of Researcher who are directly affiliated to this institution, without department.

sorted by last name (prefetches their stats as well)
stats

AccessStatistics about the papers authored in this institution.

stats_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

update_coords(sleep_time=5)[source]

Attempts to fetch the position of the institution via OpenStreetMap Nominatim.

update_stats()[source]

Refreshes the institution-level access statistics.

url

The URL of the main page (list of departments for this institution).

class papers.models.Name(id, first, last, full, best_confidence)[source]

Bases: django.db.models.base.Model, papers.baremodels.BareName

Parameters:
  • id (AutoField) – Id
  • first (CharField) – First
  • last (CharField) – Last
  • full (CharField) – Full
  • best_confidence (FloatField) – Best confidence
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

best_confidence

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

first

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod from_bare(bare_name)[source]

Calls lookup_name for the given bare_name, if it is indeed bare..

full

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod get_or_create(first, last)[source]

Replacement for the regular get_or_create, so that the full name is built based on first and last

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_known

Does this name belong to at least one known Researcher?

last

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod lookup_name(author_name)[source]

Lookup a name (pair of (first,last)) in the model. If there is already such a name in the database, returns it, otherwise creates one properly.

In addition to get_or_create, this looks for relevant researchers whose name might match this one.

namevariant_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

object_id

Criteria to use in the search view to filter on this name

objects = <django.db.models.manager.Manager object>
researcher_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

save_if_not_saved()[source]

Used to save unsaved names after lookup

class papers.models.NameVariant(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A NameVariant is a binary relation between names and researchers. When present, it indicates that a given name is a possible name for the researcher. The confidence that papers with that name are authored by the given researcher is indicated by a confidence score.

Parameters:
  • id (AutoField) – Id
  • name_id (ForeignKey) – Name
  • researcher_id (ForeignKey) – Researcher
  • confidence (FloatField) – Confidence
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

confidence

The similarity score between this name and one of the reference names for this researcher

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

The Name that is part of the relation

name_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
researcher

The Researcher to which the name is attributed

researcher_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class papers.models.OaiRecord(id, source, about, identifier, splash_url, pdf_url, description, keywords, contributors, pubtype, journal_title, container, journal, publisher, publisher_name, issue, volume, pages, pubdate, doi, last_update, priority)[source]

Bases: django.db.models.base.Model, papers.baremodels.BareOaiRecord

Parameters:
  • id (AutoField) – Id
  • source_id (ForeignKey) – Source
  • about_id (ForeignKey) – About
  • identifier (CharField) – Identifier
  • splash_url (URLField) – Splash url
  • pdf_url (URLField) – Pdf url
  • description (TextField) – Description
  • keywords (TextField) – Keywords
  • contributors (CharField) – Contributors
  • pubtype (CharField) – Pubtype
  • journal_title (CharField) – Journal title
  • container (CharField) – Container
  • journal_id (ForeignKey) – Journal
  • publisher_id (ForeignKey) – Publisher
  • publisher_name (CharField) – Publisher name
  • issue (CharField) – Issue
  • volume (CharField) – Volume
  • pages (CharField) – Pages
  • pubdate (DateField) – Pubdate
  • doi (CharField) – Doi
  • last_update (DateTimeField) – Last update
  • priority (IntegerField) – Priority
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

about

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

about_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

container

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

contributors

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

depositrecord_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

doi

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod find_duplicate_records(paper, splash_url, pdf_url)[source]

Finds duplicate OAI records. These duplicates can have a different identifier, or slightly different urls (for instance https:// instead of http://).

Parameters:
  • paper – the Paper the record is about
  • splash_url – the splash url of the target record (link to the metadata page)
  • pdf_url – the url of the PDF, if known (otherwise None)
get_next_by_last_update(*moreargs, **morekwargs)
get_previous_by_last_update(*moreargs, **morekwargs)
get_pubtype_display(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

issue

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

journal

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

journal_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

journal_title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

keywords

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_update

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod new(**kwargs)[source]

Creates a new OAI record by checking first for duplicates and updating them if necessary.

objects = <django.db.models.manager.Manager object>
pages

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pdf_url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

priority

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pubdate

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

publisher

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

publisher_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

publisher_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pubtype

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

source

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

source_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

splash_url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

update_priority()[source]
volume

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class papers.models.OaiSource(id, identifier, name, oa, priority, default_pubtype, last_status_update)[source]

Bases: caching.base.CachingMixin, django.db.models.base.Model

Parameters:
  • id (AutoField) – Id
  • identifier (CharField) – Identifier
  • name (CharField) – Name
  • oa (BooleanField) – Oa
  • priority (IntegerField) – Priority
  • default_pubtype (CharField) – Default pubtype
  • last_status_update (DateTimeField) – Last status update
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

default_pubtype

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_default_pubtype_display(*moreargs, **morekwargs)
get_next_by_last_status_update(*moreargs, **morekwargs)
get_previous_by_last_status_update(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_status_update

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
oa

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

oairecord_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <papers.models.OaiSourceManager object>
priority

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

repository_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class papers.models.OaiSourceManager[source]

Bases: caching.base.CachingManager

get_by_natural_key(identifier)[source]
class papers.models.Paper(id, title, fingerprint, date_last_ask, pubdate, authors_list, last_modified, visible, last_annotation, doctype, oa_status, pdf_url, task)[source]

Bases: django.db.models.base.Model, papers.baremodels.BarePaper

Parameters:
  • id (AutoField) – Id
  • title (CharField) – Title
  • fingerprint (CharField) – Fingerprint
  • date_last_ask (DateField) – Date last ask
  • pubdate (DateField) – Pubdate
  • authors_list (JSONField) – Authors list
  • last_modified (DateTimeField) – Last modified
  • visible (BooleanField) – Visible
  • last_annotation (CharField) – Last annotation
  • doctype (CharField) – Doctype
  • oa_status (CharField) – Oa status
  • pdf_url (URLField) – Pdf url
  • task (CharField) – Task
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_author(author, position=None)[source]

Add an author at the end of the authors list by default or at the specified position.

The change is not commited to the database (you need to call save() afterwards).

Parameters:position – add the author at that index.
add_oairecord(oairecord)[source]

Adds a record (possibly bare) to the paper, by saving it in the database

already_asked_for_upload()[source]
author_name_pairs()[source]

The authors’ names, represented as (first,last) pairs.

authors

The author sorted as they should appear. Their names are pre-fetched.

authors_list

Full list of authors for this paper

breadcrumbs()[source]

Returns the navigation path to the paper, for display as breadcrumbs in the template.

cache_oairecords()[source]

Fetches once the cache for child OaiRecords. The reason why we’re not doing this explicitly in self.oairecords is that sometimes we need fresh oairecords and so caching is not always desirable.

can_be_asked_for_upload()[source]
can_be_claimed_by(user)[source]

Is it possible for user to claim this paper?

can_be_deposited(user)[source]

Returns true when this paper can be deposited in at least one repository configured on this Dissemin instance.

claim_for(user)[source]

Associate this paper to the requested user

combined_status

The combined status of the paper (availability and policy)

consolidate_metadata(wait=True)[source]

Tries to find an abstract for the paper, if none is available yet, possibly by fetching it from Zotero via doi-cache.

classmethod create_by_doi(doi, bare=False)[source]

Creates a paper given a DOI

classmethod create_by_hal_id(hal_id, bare=False)[source]

Creates a paper given a HAL id (e.g. hal-01227383)

classmethod create_by_oai_id(oai_id, metadataPrefix=u'base_dc', bare=False)[source]

Creates a paper by its OAI identifier.

date_last_ask

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

depositrecord_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

doctype

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod find_by_fingerprint(fp)[source]
fingerprint

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod from_bare(paper)[source]

Saves a paper to the database if it is not already present. The clustering algorithm is run to decide what authors should be attributed to the paper.

Returns:the Paper instance created from the bare paper supplied.
classmethod get_by_doi(doi)[source]

Finds the paper associated to that DOI (if any)

get_doctype_display(*moreargs, **morekwargs)
get_doi()[source]

Returns any DOI associated to this Paper, None otherwise

get_next_by_last_modified(*moreargs, **morekwargs)
get_next_by_pubdate(*moreargs, **morekwargs)
classmethod get_or_create(title, author_names, pubdate, visible=True, affiliations=None)[source]

Creates an (initially) bare paper and saves it to the database.

Returns:the corresponding Paper instance.
get_previous_by_last_modified(*moreargs, **morekwargs)
get_previous_by_pubdate(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

invalidate_cache()[source]

Invalidate the HTML cache for all the publications of this researcher.

is_deposited
is_owned_by(user, flexible=False)[source]

Is this user one of the owners of that paper?

:param flexible: if set to true, we will also accept the user
as owner if its name matches any of the author names.
last_annotation

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_modified

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

merge(paper)[source]

Merges another paper into self. This deletes the other paper. We do our best to unify all the metadata parts, but of course there will always be some mistakes as there is no way to find out which metadata part is best in general.

Parameters:paper – The second paper to merge and delete.
oa_status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

oairecord_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

oairecords

The list of OAI records associated with this paper, returned as a queryset.

objects = <django.db.models.manager.Manager object>
owners

Returns the list of users that own this paper (listed as authors and identified as such).

pdf_url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pubdate

Approximate publication date. For instance if we only know it is in 2014 we’ll put 2014-01-01

publications

The list of publications associated with this paper, returned as a queryset.

recompute_fingerprint_and_merge_if_needed()[source]

Recomputes the fingerprint based on the new values of the paper’s attributes, checks whether there is already another paper with the same fingerprint, and if so merge them.

remove_from_index()[source]

Remove this paper from Haystack’s index (to be called before deleting the paper for real)

researcher_ids

The list of researcher ids associated with this paper, returned as a list.

researchers

The list of researchers associated with this paper, returned as a list of Researcher instances.

set_researcher(position, researcher_id)[source]

Sets the researcher_id for the author at the given position (0-indexed). researcher_id can be set to None to unaffiliate an author with a researcher.

status_helptext()[source]

Helptext displayed next to the paper logo

successful_deposits()[source]
task

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

unclaim_for(user)[source]

Remove all associations between this paper and user

update_author_stats()[source]

Updates the statistics of all researchers identified for this paper

update_authors(new_authors, save_now=True)[source]

Improves the current list of authors by considering a new list of author names. Missing authors are added, and names are unified. If affiliations are provided, they will replace the old ones if they are more informative.

Parameters:authors – list of BareAuthor instances (the order matters)
update_availability(cached_oairecords=[])[source]

Updates the Paper’s own pdf_url field based on its sources (OaiRecord).

This uses a non-trivial logic, hence it is useful to keep this result cached in the database row.

Parameters:cached_oairecords – if the list of oairecords to be considered is already available to the caller, it can pass it to this function to save a db query
update_index()[source]

Updates Haystack’s index for this paper

update_visible()[source]

Should this paper be shown to users?

url
visible

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class papers.models.PaperWorld(*args, **kwargs)[source]

Bases: solo.models.SingletonModel

A singleton to link to a special instance of AccessStatistics for all papers

Parameters:
  • id (AutoField) – Id
  • stats_id (ForeignKey) – Stats
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

object_id
objects = <django.db.models.manager.Manager object>
stats

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

stats_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

update_stats()[source]

Update the access statistics for all papers

class papers.models.Researcher(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A model to represent a researcher

Parameters:
  • id (AutoField) – Id
  • name_id (ForeignKey) – Name
  • user_id (ForeignKey) – User
  • department_id (ForeignKey) – Department
  • institution_id (ForeignKey) – Institution
  • email (EmailField) – Email
  • homepage (URLField) – Homepage
  • role (CharField) – Role
  • orcid (CharField) – Orcid
  • empty_orcid_profile (NullBooleanField) – Empty orcid profile
  • last_harvest (DateTimeField) – Last harvest
  • harvester (CharField) – Harvester
  • current_task (CharField) – Current task
  • stats_id (ForeignKey) – Stats
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_name_variant(name, confidence, force_update=False)[source]

Add a name variant with the given confidence and update the best_confidence field of the name accordingly.

Parameters:force_update – set the best_confidence even if the current value is higher.
affiliation_form()[source]

Returns a form to change the affiliation of this researcher

breadcrumbs()[source]

We include the most detailed affiliation for the researcher

classmethod create_by_name(first, last, **kwargs)[source]

Creates a Researcher with the given name. If an ORCID is provided, and a researcher with this ORCID already exists, this researcher will be returned. In any other case, a new researcher will be created.

current_task

Current subtask of the harvester

department

It can be affiliated to a department

department_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

email

Email address for this researcher

empty_orcid_profile

Did we manage to import at least one record from the ORCID profile? (Null if we have not tried)

fetch_everything()[source]
fetch_everything_if_outdated()[source]
get_current_task_display(*moreargs, **morekwargs)
classmethod get_or_create_by_orcid(orcid, profile=None, user=None, update=False, instance='orcid.org')[source]

Creates (or returns an existing) researcher from its ORCID id.

Parameters:
  • profile – an OrcidProfile object if it has already been fetched from the API (otherwise we will fetch it ourselves)
  • user – an user to associate with the profile.
  • update – refresh researcher attributes even if it already exists
Returns:

a Researcher if everything went well, raises MetadataSourceException otherwise

harvester

Task id of the harvester (if any)

homepage

URL of the homepage

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

init_from_orcid()[source]
institution

Or directly to an institution

institution_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_harvest

Last time we harvested publications for this researcher

latest_paper

Returns the latest paper authored by this researcher, if any.

matching_papers_url

URL of the search page for papers with a matching name

name

The preferred Name for this researcher

name_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_variants

All the names found in papers that could belong to the researcher. Among these names, at least the preferred name should have confidence 1.0 (other names can have confidence 1.0 if multiple names are known. The other names have been found in publications and are similar to one of these 1.0 confidence name variants.

namevariant_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

object_id

Criteria to use in the search view to filter on this researcher

objects = <django.db.models.manager.Manager object>
orcid

ORCiD identifier

papers

Paper objects for this researcher, sorted by decreasing publication date

role

Grade (student, post-doc, professor…)

slug
stats

Statistics of papers authored by this researcher

stats_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

update_stats()[source]

Update the access statistics for the papers authored by this researcher

url
user

It can be associated to a user

user_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

papers.models.create_default_stats()[source]