literature.managers module#

class literature.managers.AuthorQuerySet(model=None, query=None, using=None, hints=None)[source]#

Bases: QuerySet

as_lead()[source]#

Convenience filter for retrieving only authors that are listed as the lead author on a publication.

is_active()[source]#
with_last_published()[source]#
with_work_counts()[source]#

Convenience filter for retrieving authors with annotated counts of works published as either lead or supporting author.

These count attributes can be accessed on the queryset as as_lead or as_supporting. Further filtering/manipulation is possible on both fields afterwards.

Example

Get authors that have published at least five works as lead author.

>>> Author.objects.with_work_counts().filter(as_lead__gte=5)

Get authors that have published only once but have been a supporting author on at least three.

>>> Author.objects.with_work_counts().filter(as_lead=1, as_supporting__gte=3)
class literature.managers.LiteratureQuerySet(model=None, query=None, using=None, hints=None)[source]#

Bases: QuerySet

get_or_resolve(doi)[source]#

Loops through all available remote adaptors and attempts to resolve the given DOI until succesful.

Parameters:

doi (_type_) – _description_

resolve_doi(doi, adaptor=None)[source]#

Attempts to fetch a doi from a remote data source. Loops through the available remote adaptors until the doi is succesfully resolved. If the doi registrar (source) is known, you may supply the appropriate adaptor to prevent searching other registries.

Parameters:
  • doi (_type_) – _description_

  • adaptor (_type_, optional) – _description_. Defaults to None.

Returns:

_description_

Return type:

_type_