cv.models — Django-Vitae 0.0.1 documentation

# `cv.models`

Reference for `cv.models` generated from docstrings.

## Publications

Defines Django-CV publication models.

class `cv.models.publications.` `Article`(*args, **kwargs)

  Store instance representing an article.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – title (CharField) – (required) short_title (CharField) – (required) slug (SlugField) – (required), Automatically built from short title primary_discipline_id (ForeignKey to `Discipline`) – status (IntegerField) – (required) pub_date (DateField) – submission_date (DateField) – is_published (BooleanField) – (required) is_inrevision (BooleanField) – (required) is_inprep (BooleanField) – (required) abstract (TextField) – journal_id (ForeignKey to `Journal`) – volume (CharField) – issue (CharField) – start_page (CharField) – end_page (CharField) – series (CharField) – number (CharField) – url (URLField) – doi (CharField) – pmcid (CharField) – , PubMed Central reference number (for more info see: https://publicaccess.nih.gov/include-pmcid-citations.htm#Difference) pmid (CharField) – , PubMed Central reference number (for more info see: https://publicaccess.nih.gov/include-pmcid-citations.htm#Difference) abstract_html (TextField) – other_disciplines (ManyToManyField) – authors (ManyToManyField) – (required) grants (ManyToManyField) – files (GenericRelation) –

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.publications.` `ArticleAuthorship`(*args, **kwargs)

  Store object relating collaborators to article.

  Parameters: | id (AutoField) – collaborator_id (ForeignKey to `Collaborator`) – (required) print_middle (BooleanField) – (required), Display author’s middle initial? display_order (IntegerField) – (required), Order that collaborators should be listed student_colleague (IntegerField) – article_id (ForeignKey to `Article`) – (required)

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.publications.` `Book`(*args, **kwargs)

  Store instance representing a book.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – title (CharField) – (required) short_title (CharField) – (required) slug (SlugField) – (required), Automatically built from short title primary_discipline_id (ForeignKey to `Discipline`) – status (IntegerField) – (required) pub_date (DateField) – submission_date (DateField) – is_published (BooleanField) – (required) is_inrevision (BooleanField) – (required) is_inprep (BooleanField) – (required) abstract (TextField) – publisher (CharField) – place (CharField) – volume (IntegerField) – series (CharField) – series_number (CharField) – num_pages (IntegerField) – isbn (CharField) – url (URLField) – abstract_html (TextField) – other_disciplines (ManyToManyField) – authors (ManyToManyField) – (required) grants (ManyToManyField) – files (GenericRelation) –

  `add_edition`(**kwargs)

    Add edition to book.

  `get_editions`()

    Return queryset of all editions associated with book.

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.publications.` `BookAuthorship`(*args, **kwargs)

  Store authorship object relating collaborators to book.

  Parameters: | id (AutoField) – collaborator_id (ForeignKey to `Collaborator`) – (required) print_middle (BooleanField) – (required), Display author’s middle initial? display_order (IntegerField) – (required), Order that collaborators should be listed student_colleague (IntegerField) – book_id (ForeignKey to `Book`) – (required)

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.publications.` `BookEdition`(*args, **kwargs)

  Store edition information of a book.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – book_id (ForeignKey to `Book`) – (required) edition (CharField) – (required) pub_date (DateField) – submission_date (DateField) – publisher (CharField) – place (CharField) – num_pages (IntegerField) – isbn (CharField) – files (GenericRelation) –

  `clean`()

    Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.publications.` `Chapter`(*args, **kwargs)

  Store instance representing book chapter.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – title (CharField) – (required) short_title (CharField) – (required) slug (SlugField) – (required), Automatically built from short title primary_discipline_id (ForeignKey to `Discipline`) – abstract (TextField) – status (IntegerField) – (required) pub_date (DateField) – submission_date (DateField) – is_published (BooleanField) – (required) is_inrevision (BooleanField) – (required) is_inprep (BooleanField) – (required) book_title (CharField) – (required) volume (CharField) – volumes (CharField) – edition (CharField) – publisher (CharField) – place (CharField) – series (CharField) – series_number (CharField) – start_page (CharField) – end_page (CharField) – isbn (CharField) – url (URLField) – abstract_html (TextField) – other_disciplines (ManyToManyField) – authors (ManyToManyField) – (required) editors (ManyToManyField) – grants (ManyToManyField) – files (GenericRelation) –

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.publications.` `ChapterAuthorship`(*args, **kwargs)

  Store object relating collaborators to article.

  Parameters: | id (AutoField) – collaborator_id (ForeignKey to `Collaborator`) – (required) print_middle (BooleanField) – (required), Display author’s middle initial? display_order (IntegerField) – (required), Order that collaborators should be listed student_colleague (IntegerField) – chapter_id (ForeignKey to `Chapter`) – (required)

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.publications.` `ChapterEditorship`(*args, **kwargs)

  Store object relating editors to chapter.

  Parameters: | id (AutoField) – collaborator_id (ForeignKey to `Collaborator`) – (required) print_middle (BooleanField) – (required), Display author’s middle initial? display_order (IntegerField) – (required), Order that collaborators should be listed chapter_id (ForeignKey to `Chapter`) – (required)

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.publications.` `Report`(*args, **kwargs)

  Store instance representing reports.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – title (CharField) – (required) short_title (CharField) – (required) slug (SlugField) – (required), Automatically built from short title primary_discipline_id (ForeignKey to `Discipline`) – abstract (TextField) – status (IntegerField) – (required) pub_date (DateField) – submission_date (DateField) – is_published (BooleanField) – (required) is_inrevision (BooleanField) – (required) is_inprep (BooleanField) – (required) report_number (CharField) – report_type (CharField) – series_title (CharField) – place (CharField) – institution (CharField) – pages (CharField) – url (URLField) – doi (CharField) – abstract_html (TextField) – other_disciplines (ManyToManyField) – authors (ManyToManyField) – (required) grants (ManyToManyField) – files (GenericRelation) –

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.publications.` `ReportAuthorship`(*args, **kwargs)

  Store object relating collaborators to report.

  Parameters: | id (AutoField) – collaborator_id (ForeignKey to `Collaborator`) – (required) print_middle (BooleanField) – (required), Display author’s middle initial? display_order (IntegerField) – (required), Order that collaborators should be listed student_colleague (IntegerField) – report_id (ForeignKey to `Report`) – (required)

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

## Works

class `cv.models.works.` `Grant`(*args, **kwargs)

  Create instance of funded grant.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – title (CharField) – (required) short_title (CharField) – (required) slug (SlugField) – (required), Automatically built from short title primary_discipline_id (ForeignKey to `Discipline`) – source (IntegerField) – (required), Internal/external source of funding agency (CharField) – agency_acronym (CharField) – division (CharField) – division_acronym (CharField) – grant_number (CharField) – amount (IntegerField) – (required) start_date (DateField) – (required) end_date (DateField) – role (CharField) – is_current (BooleanField) – (required) abstract (TextField) – abstract_html (TextField) – other_disciplines (ManyToManyField) – collaborators (ManyToManyField) – (required) files (GenericRelation) –

  `save`(force_insert=False, force_update=False, *args, **kwargs)

    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`
  exception `MultipleObjectsReturned`

class `cv.models.works.` `GrantCollaboration`(*args, **kwargs)

  Store object relating collaborators to grant.

  Parameters: | id (AutoField) – collaborator_id (ForeignKey to `Collaborator`) – (required) print_middle (BooleanField) – (required), Display author’s middle initial? display_order (IntegerField) – (required), Order that collaborators should be listed grant_id (ForeignKey to `Grant`) – (required) is_pi (BooleanField) – (required) role (CharField) –

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.works.` `Talk`(*args, **kwargs)

  Store object representing a talk.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – title (CharField) – (required) short_title (CharField) – (required) slug (SlugField) – (required), Automatically built from short title primary_discipline_id (ForeignKey to `Discipline`) – abstract (TextField) – abstract_html (TextField) – latest_presentation_date (DateField) – created (DateField) – modified (DateField) – other_disciplines (ManyToManyField) – collaborator (ManyToManyField) – grants (ManyToManyField) – files (GenericRelation) –

  `save`(force_insert=False, force_update=False, *args, **kwargs)

    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`
  exception `MultipleObjectsReturned`

class `cv.models.works.` `Presentation`(*args, **kwargs)

  Create an instance in which a talk was given.

  This model creates separate objects for each time the same talk was given.

  Parameters: | id (AutoField) – talk_id (ForeignKey to `Talk`) – (required) presentation_date (DateField) – (required) type (IntegerField) – (required) event (CharField) – (required) event_acronym (CharField) – city (CharField) – state (CharField) – country (CharField) –

  `save`(*args, **kwargs)

    Save latest presentation date in related talk if instance is later than current latest presentation date.

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.works.` `OtherWriting`(*args, **kwargs)

  Create an instance of writing in venues other than traditional scholarly venues.

  Default ordering by `type` and then `date` in descending order.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – title (CharField) – (required) short_title (CharField) – (required) slug (SlugField) – (required), Automatically built from short title primary_discipline_id (ForeignKey to `Discipline`) – type (CharField) – , Genre of writing (e.g., ‘book review’,’op ed’, ‘blog post’) that can be used for grouping contributions by type. abstract (TextField) – venue (CharField) – (required) date (DateField) – (required) pages (CharField) – url (URLField) – place (CharField) – volume (CharField) – issue (CharField) – abstract_html (TextField) – other_disciplines (ManyToManyField) – files (GenericRelation) –

  `save`(force_insert=False, force_update=False, *args, **kwargs)

    Saves abstract in html format.

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.works.` `Dataset`(*args, **kwargs)

  Stores instance representing a dataset.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – title (CharField) – (required) short_title (CharField) – (required) slug (SlugField) – (required), Automatically built from short title primary_discipline_id (ForeignKey to `Discipline`) – pub_date (DateField) – version_number (CharField) – format (CharField) – , Form of data (e.g., ‘Datafile and Codebook’ or ‘Datafile’) producer (CharField) – producer_place (CharField) – distributor (CharField) – distributor_place (CharField) – retrieval_url (URLField) – , Used for URL linked to dataset available_from_url (URLField) – , Used to link to a download page doi (CharField) – other_disciplines (ManyToManyField) – authors (ManyToManyField) – (required) files (GenericRelation) –

  `get_absolute_url`()

    “Returns reverse URL for an instance of a dataset.

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.works.` `DatasetAuthorship`(*args, **kwargs)

  Store object relating creators of dataset to a dataset instance.

  Parameters: | id (AutoField) – collaborator_id (ForeignKey to `Collaborator`) – (required) print_middle (BooleanField) – (required), Display author’s middle initial? display_order (IntegerField) – (required), Order that collaborators should be listed student_colleague (IntegerField) – dataset_id (ForeignKey to `Dataset`) – (required)

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

## Base Models

class `cv.models.base.` `DisplayableModel`(*args, **kwargs)

  Abstract class including fields shared by all CV models.

  `DisplayableModel` makes the `displayable` manager available to all models that inherit from it that returns all instances where `display==True`.

  > display : boolean (required) Indicates whether model instance should be displayed and returned by `cv.models.DisplayManager`. Defaults to `True`.

  extra : string
    Text to be included with instance of model. Should be written in final format.
  files : `GenericRelation` to `cv.models.CVFile`
    Relates files to model.

  Note

  due to rules that Django uses to load managers, it will be defined as the default manager)

  Parameters: | display (BooleanField) – (required) extra (TextField) – files (GenericRelation) –

class `cv.models.base.` `Collaborator`(*args, **kwargs)

  Store object representing collaborator.

  By default, collaborators are ordered (in ascending order) by last name. Internally, Django-CV uses the `email` attribute to identify collaborators. For example, the template filter `print_authors()` matches collaborators on e-mails to emphasize key contributors in the list of CV entries based on the list defined in the `CV_KEY_CONTRIBUTORS_LIST` setting.

  Parameters: | id (AutoField) – first_name (CharField) – (required) last_name (CharField) – (required) email (EmailField) – (required) middle_initial (CharField) – suffix (CharField) – institution (CharField) – website (URLField) – alternate_email (EmailField) –

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.base.` `CollaborationModel`(*args, **kwargs)

  Abstract model to connect collaborators to products.

  > collaborator : `models.ForeignKey` relationship to `Collaborator` Foreign key of collaborator.

  print_middle : boolean
    Indicates that the collaborator’s middle initial should be included.
  display_order : integer (required)
    Order that collaborators should be listed when printed.

  Parameters: | collaborator_id (ForeignKey to `Collaborator`) – (required) print_middle (BooleanField) – (required), Display author’s middle initial? display_order (IntegerField) – (required), Order that collaborators should be listed

class `cv.models.base.` `StudentCollaborationModel`(*args, **kwargs)

  Abstract model to include whether collaborator was a student.

  Parameters: | student_colleague (IntegerField) –

class `cv.models.base.` `Discipline`(*args, **kwargs)

  Store object representing disciplines in which work can be published.

  Some models include a Foreign Key relationship to Discipline to allow instances to be classified by discipline (e.g., to sort CV by discipline in which articles are published)

  Parameters: | id (AutoField) – name (CharField) – (required) slug (SlugField) – (required)

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.base.` `VitaeModel`(*args, **kwargs)

  Create reusable model containing basic titling and discipline fields.

  Parameters: | display (BooleanField) – (required) extra (TextField) – title (CharField) – (required) short_title (CharField) – (required) slug (SlugField) – (required), Automatically built from short title primary_discipline_id (ForeignKey to `Discipline`) – other_disciplines (ManyToManyField) – files (GenericRelation) –

class `cv.models.base.` `VitaePublicationModel`(*args, **kwargs)

  Create reusable model containing managers for different types of publications based on VitaeModel fields

  Parameters: | display (BooleanField) – (required) extra (TextField) – title (CharField) – (required) short_title (CharField) – (required) slug (SlugField) – (required), Automatically built from short title primary_discipline_id (ForeignKey to `Discipline`) – abstract (TextField) – status (IntegerField) – (required) pub_date (DateField) – submission_date (DateField) – is_published (BooleanField) – (required) is_inrevision (BooleanField) – (required) is_inprep (BooleanField) – (required) other_disciplines (ManyToManyField) – files (GenericRelation) –

  `save`(*args, **kwargs)

    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.

  `clean`(*args, **kwargs)

    Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

  `get_primary_files`()

    Return queryset of `cv.models.CVFile` objects designated as “primary files” associated with article.

  `cite`()

    Return citation based on format defined in CV_CSL_STYLE setting.

class `cv.models.base.` `Journal`(*args, **kwargs)

  Store object representing journal/periodical in field.

  Three fields are required: * `title` (the title of journal)

  - `issn` (the International Standard Serial Number , written in the format XXXX-XXXX), and
  - `primary_discipline` (a Foreign Key to `cv.Discipline`)

  Parameters: | id (AutoField) – title (CharField) – (required) abbreviated_title (CharField) – , Abbreviated journal title; use style you wish to display in views issn (CharField) – (required), Enter ISSN in format: XXXX-XXXX website (URLField) – primary_discipline_id (ForeignKey to `Discipline`) – (required) other_disciplines (ManyToManyField) –

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.base.` `Award`(*args, **kwargs)

  Store object representing an award earned.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – name (CharField) – (required) organization (CharField) – (required) date (DateField) – (required) description (TextField) – files (GenericRelation) –

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.base.` `Degree`(*args, **kwargs)

  Store object representing degree earned.

  Degrees are sorted by `end_date`.

  This class contains two managers: * `objects`: return all positions * `displayable`: return only positions for which `display==True`

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – degree (CharField) – (required) major (CharField) – date_earned (DateField) – (required) institution (CharField) – (required) city (CharField) – (required) state (CharField) – (required) country (CharField) – (required) honors (CharField) – files (GenericRelation) –

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.base.` `Position`(*args, **kwargs)

  Store single position object representing employment or research experience.

  Positions are sorted by `end_date`.

  This class contains three managers: * `objects`: return all positions

  - `displayable`: return only positions for which `display==True`
  - `primarypositions`: return only positions for which `primary_position==True` (indicating a primary position should be used sparingly since it will be used, for example, in the heading of a CV)

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – title (CharField) – (required) start_date (DateField) – (required) end_date (DateField) – (required), If current, set date to future (by default positions will be ordered by end date project (CharField) – department (CharField) – institution (CharField) – (required) current_position (BooleanField) – (required), Are you currently in this position? primary_position (BooleanField) – (required), Should this position be displayed as the main position (e.g., on heading of CV)? files (GenericRelation) –

  `clean`()

    Ensure start date is before end date.

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.base.` `MediaMention`(*args, **kwargs)

  Store object containing media mention.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – outlet (CharField) – (required), Publication or station section (CharField) – , Section of publication or program title (CharField) – date (DateField) – (required) url (URLField) – author (CharField) – , E.g., author of written piece or interviewer on visual medium description (TextField) – snapshot (FileField) – files (GenericRelation) –

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.base.` `DepartmentServiceManager`

  Return queryset of services perfomed for department.

  `get_queryset`()

    Return a new QuerySet object. Subclasses can override this method to customize the behavior of the Manager.

class `cv.models.base.` `UniversityServiceManager`

  Return queryset of services perfomed for university.

  `get_queryset`()

    Return a new QuerySet object. Subclasses can override this method to customize the behavior of the Manager.

class `cv.models.base.` `DisciplineServiceManager`

  Return queryset of services perfomed for university.

  `get_queryset`()

    Return a new QuerySet object. Subclasses can override this method to customize the behavior of the Manager.

class `cv.models.base.` `Service`(*args, **kwargs)

  Add object to record service commitments.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – role (CharField) – (required) group (CharField) – , Group or committee on which service was performed organization (CharField) – (required) type (IntegerField) – (required) start_date (DateField) – , Leave blank of one-time service end_date (DateField) – , Leave blank if service is ongoing description (TextField) – files (GenericRelation) –

  `clean`()

    Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.base.` `JournalService`(*args, **kwargs)

  Objects representing journals for which one has reviewed.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – journal_id (OneToOneField to `Journal`) – is_reviewer (BooleanField) – (required) files (GenericRelation) –

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.base.` `Student`(*args, **kwargs)

  Add object to represent students that have been advised.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – first_name (CharField) – (required) last_name (CharField) – (required) middle_name (CharField) – student_level (IntegerField) – role (CharField) – (required) thesis_title (CharField) – is_current_student (BooleanField) – (required) graduation_date (DateField) – first_position (CharField) – current_position (CharField) – files (GenericRelation) –

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.base.` `Course`(*args, **kwargs)

  Instance of a class or course prepared.

  Parameters: | id (AutoField) – display (BooleanField) – (required) extra (TextField) – title (CharField) – (required) slug (SlugField) – short_description (TextField) – full_description (TextField) – student_level (IntegerField) – short_description_html (TextField) – (required) description_html (TextField) – (required) last_offered (DateField) – files (GenericRelation) –

  `save`(force_insert=False, force_update=False)

    Prepares html versions and records last offering.

    Saves the markdown input into html to reduce load on templates and updates last_offered field to latest CourseOffering instance associated with the class.

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`

class `cv.models.base.` `CourseOffering`(*args, **kwargs)

  Instance of a term when a course was taught.

  Parameters: | id (AutoField) – course_id (ForeignKey to `Course`) – (required) term (IntegerField) – (required) start_date (DateField) – end_date (DateField) – institution (CharField) – course_number (CharField) – is_current_offering (BooleanField) – (required)

  exception `DoesNotExist`
  exception `MultipleObjectsReturned`