organizations.models module

class organizations.models.Organization(*args, **kwargs)[source]

Bases: django.db.models.base.Model

An Organization instance is any type of administrative unit which SciPost can interact with. Example types include universities, funding agencies, research institutes etc.

All instances can only be created by SciPost administration-level personnel, and can thus be considered as verified.

These objects are meant to be internally linked to all other types of (possibly user-defined) objects used throughout the site (such as Institutions, Partners, Affiliations, Funders etc). This enables relating all of SciPost’s services to the organizations which are impacted by its activities.

The data here is also meant to be cross-linked to external databases, for example the Global Research Identifier Database (GRID), Crossref, ORCID etc.

orgtype

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

status

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.

name_original

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

acronym

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

country

A descriptor for country fields on a model instance. Returns a Country when accessed so you can do things like:

>>> from people import Person
>>> person = Person.object.get(name='Chris')

>>> person.country.name
'New Zealand'

>>> person.country.flag
'/static/flags/nz.gif'
address

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

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

css_class

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

grid_json

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

crossref_json

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

parent

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

superseded_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

cf_nr_associated_publications

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.ManagerFromOrganizationQuerySet object>
property full_name
property full_name_with_acronym
get_absolute_url()[source]
property details_publicly_viewable
get_publications()[source]
count_publications()[source]
update_cf_nr_associated_publications()[source]

Update the calculated field Organization:cf_nr_associated_publications.

pubfraction_for_publication(doi_label)[source]

Return the organization’s pubfraction for this publication, or the string ‘Not defined’.

pubfractions_in_year(year)[source]

Returns the sum of pubfractions for the given year.

get_author_profiles()[source]

Returns all Profiles of authors associated to this Organization.

property has_current_agreement

Check if this organization has a current Partnership agreement.

property has_current_subsidy

Check if this organization has a Subsidy with a still-running validity period.

property latest_subsidy_date_until

Returns the end date of validity of the latest subsidy.

get_total_subsidies_obtained(n_years_past=None)[source]

Computes the total amount received by SciPost, in the form of subsidies from this Organization.

get_total_contribution_obtained(n_years_past=None)[source]

Computes the contribution obtained from this organization, summed over all time.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

affiliations

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.

children

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.

contactperson_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.

contactrole_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.

funder_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(*, field=<django_countries.fields.CountryField: country>)
get_orgtype_display(*, field=<django.db.models.fields.CharField: orgtype>)
get_status_display(*, field=<django.db.models.fields.CharField: status>)
id

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

organization_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.

organizationevent_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.

parent_id

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

petition_signatories

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.

pubfractions

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.

publicationauthorstable_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

subsidy_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.

superseded_by_id

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

class organizations.models.OrganizationEvent(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Documents an event related to an Organization.

organization

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

event

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

comments

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

noted_on

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

noted_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

get_event_display(*, field=<django.db.models.fields.CharField: event>)
get_next_by_noted_on(*, field=<django.db.models.fields.DateTimeField: noted_on>, is_next=True, **kwargs)
get_previous_by_noted_on(*, field=<django.db.models.fields.DateTimeField: noted_on>, is_next=False, **kwargs)
id

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

noted_by_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>
organization_id

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

class organizations.models.ContactPerson(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A ContactPerson instance holds information about a person who can function as a contact for one or more organizations. These instances are created by SPAdmin during sponsor harvesting. Instances can be promoted to Contact instances, which possess login credentials.

organization

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

title

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

first_name

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

last_name

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

email

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

role

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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

get_title_display(*, field=<django.db.models.fields.CharField: title>)
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>
organization_id

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

class organizations.models.Contact(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A Contact instance is a basic User to be used for Organization-type contacts. Specific Organizations are linked to Contact via the ContactRole model defined below.

user

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

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

title

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

activation_key

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

key_expires

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

generate_key(feed='')[source]

Generate and save a new activation_key for the Contact, given a certain feed.

save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

get_next_by_key_expires(*, field=<django.db.models.fields.DateTimeField: key_expires>, is_next=True, **kwargs)
get_previous_by_key_expires(*, field=<django.db.models.fields.DateTimeField: key_expires>, is_next=False, **kwargs)
get_title_display(*, field=<django.db.models.fields.CharField: title>)
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>
roles

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.

user_id

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

class organizations.models.ContactRole(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A ContactRole instance links a Contact to an Organization, for a specific set of roles and for a specific period in time.

contact

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

organization

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

kind

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

date_from

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

date_until

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

property get_kind_display

Due to a lack of support to use get_FOO_display in a ArrayField, one has to create one ‘manually’.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

contact_id

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

get_next_by_date_from(*, field=<django.db.models.fields.DateField: date_from>, is_next=True, **kwargs)
get_next_by_date_until(*, field=<django.db.models.fields.DateField: date_until>, is_next=True, **kwargs)
get_previous_by_date_from(*, field=<django.db.models.fields.DateField: date_from>, is_next=False, **kwargs)
get_previous_by_date_until(*, field=<django.db.models.fields.DateField: date_until>, is_next=False, **kwargs)
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>
organization_id

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