eucrim.article package

Submodules

eucrim.article.apps module

class eucrim.article.apps.ArticleConfig(app_name, app_module)[source]

Bases: AppConfig

name = 'eucrim.article'
ready()[source]

Override this method in subclasses to run code when Django starts.

eucrim.article.filters module

class eucrim.article.filters.ArticleFilter(data=None, queryset=None, *, request=None, prefix=None)[source]

Bases: FilterSet

class Meta[source]

Bases: object

fields = ['article_type', 'language']
model

alias of ArticlePage

base_filters = {'article_type': <django_filters.filters.ChoiceFilter object>, 'language': <django_filters.filters.ChoiceFilter object>}
declared_filters = {'article_type': <django_filters.filters.ChoiceFilter object>, 'language': <django_filters.filters.ChoiceFilter object>}
class eucrim.article.filters.ArticleTypeWidget(attrs=None, choices=())[source]

Bases: DropdownLinkWidget

label = 'Type'
property media
right = False
class eucrim.article.filters.LanguageWidget(attrs=None, choices=())[source]

Bases: DropdownLinkWidget

label = 'Language'
property media
right = False

eucrim.article.forms module

class eucrim.article.forms.ArticleForm(data=None, files=None, parent_page=None, subscription=None, *args, **kwargs)[source]

Bases: WagtailAdminPageForm

Override the standard WagtailAdminPageForm for custom validation that appears as a non-field error see: http://docs.wagtail.io/en/stable/advanced_topics/customisation/page_editing_interface.html#customising-generated-forms # noqa: E501

base_fields = {'comment_notifications': <django.forms.fields.BooleanField object>}
clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

declared_fields = {'comment_notifications': <django.forms.fields.BooleanField object>}
property media

Return all media required to render the widgets on this form.

save(commit=True)[source]

Save this form’s self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance.

eucrim.article.models module

class eucrim.article.models.ArticleIndexPage(id, path, depth, numchild, translation_key, locale, latest_revision, live, has_unpublished_changes, first_published_at, last_published_at, live_revision, go_live_at, expire_at, expired, locked, locked_at, locked_by, title, draft_title, slug, content_type, url_path, owner, seo_title, show_in_menus, search_description, latest_revision_created_at, alias_of, page_ptr, paginate_articles_at)[source]

Bases: HideShowInMenusField, RoutablePageMixin, Page

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: NotUpdated

ajax_template = None
articles()[source]
filterarticles(request, *args, **kwargs)[source]
get_context(request, *args, **kwargs)[source]
index_entries

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

is_creatable = True
max_count = 1
page_ptr

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.

page_ptr_id
paginate_articles_at

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

parent_page_types = ['core.HomePage']
settings_panels = [<wagtail.models.panels.PanelPlaceholder object>, <wagtail.models.panels.CommentPanelPlaceholder object>, <FieldPanel 'paginate_articles_at' with model=None>]
show_in_menus = True
subpage_types = ['ArticlePage']
template = 'article/article_index_page.html'
class eucrim.article.models.ArticlePage(id, path, depth, numchild, translation_key, locale, latest_revision, live, has_unpublished_changes, first_published_at, last_published_at, live_revision, go_live_at, expire_at, expired, locked, locked_at, locked_by, title, draft_title, slug, content_type, url_path, owner, seo_title, show_in_menus, search_description, latest_revision_created_at, alias_of, page_ptr, subtitle, publication_date, notify_authors, notify_authors_triggered_at, doi_id, article_type, issue, issue_page_from, issue_page_to, word_file, language, excerpt, pdf_file, pdf_file_linktext, pdf_file_cover_image, author_statement, as_html5, auto_excerpt, article_pdf_generated)[source]

Bases: HideShowInMenusField, RoutablePageMixin, AbstractPublicationPage

ARTICLE = 'AR'
ARTICLE_TYPE_CHOICES = (('AR', 'Article'), ('ED', 'Editorial'))
exception DoesNotExist

Bases: ObjectDoesNotExist

EDITORIAL = 'ED'
ENGLISH = 'EN'
FRENCH = 'FR'
GERMAN = 'GE'
LANGUAGE_CHOICES = (('GE', 'German'), ('EN', 'English'), ('FR', 'French'))
exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

ajax_template = None
arcana_markdown()[source]
article_authors
property article_index_page
article_jats(request)[source]

View function to generate and serve a JATS XML representation for a given ArticlePage.

article_pdf(request)[source]

View function for to generate a PDF for a given ArticlePage.

article_pdf_generated

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
article_type

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

as_html5

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

property as_markdown
author_statement

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

property authors
authors_panels = [<InlinePanel with model=None>, <FieldPanel 'author_statement' with model=None>, <MultiFieldPanel with model=None>]
auto_excerpt

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

base_form_class

alias of ArticleForm

bibtex(request)[source]

View function for a bibtex file export

content_panels = [<wagtail.models.panels.PanelPlaceholder object>, <FieldPanel 'subtitle' with model=None>, <FieldPanel 'excerpt' with model=None>, <FieldPanel 'word_file' with model=None>, <InlinePanel with model=None>, <MultiFieldPanel with model=None>, <MultiFieldPanel with model=None>]
doi_id

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

edit_handler = <TabbedInterface with model=None>
excerpt

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

property get_article_pdf_filename
get_article_type_display(*, field=<django.db.models.fields.CharField: article_type>)
property get_authors_list
get_citation(from_doi=False, style='apa')[source]

Get a formatted citation for this article.

Args:

from_doi (bool): If True, fetch citation from DOI service. style (str): Citation style (apa, mla, chicago, harvard, etc.) or “eucrim_internal”.

Returns:

str: Formatted citation or None if no DOI available

property get_doi
property get_issue_title

This property is used for the article export in the custom ExportableArticleIndexView

get_language_display(*, field=<django.db.models.fields.CharField: language>)
property get_obj_og_description
property get_obj_og_image
property get_pdf_filename
property has_been_modified
index_entries

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

is_creatable = True
issue

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.

issue_id
issue_page_from

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

issue_page_to

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

language

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

notify_authors

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

notify_authors_triggered_at

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

objects = <eucrim.article.models.ArticlePageManager object>
page_ptr

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.

page_ptr_id
parent_page_types = ['article.ArticleIndexPage']
pdf_file

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
pdf_file_cover_image

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.

pdf_file_cover_image_id
pdf_file_linktext

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

promote_panels = [<MultiFieldPanel with model=None>, <HelpPanel with model=None>]
publication_date

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

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

In case publication_date is not set or is 1970-01-01 (our import default value), set publication_date to first_published_at date. This ensures we could use publication_date for all orderings etc.

search_fields = [<SearchField: title>, <AutocompleteField: title>, <FilterField: title>, <FilterField: id>, <FilterField: live>, <FilterField: owner>, <FilterField: content_type>, <FilterField: path>, <FilterField: depth>, <FilterField: locked>, <FilterField: show_in_menus>, <FilterField: first_published_at>, <FilterField: last_published_at>, <FilterField: latest_revision_created_at>, <FilterField: locale>, <FilterField: translation_key>, <SearchField: subtitle>, <SearchField: doi_id>, <SearchField: excerpt>, <SearchField: auto_excerpt>, <SearchField: as_html5>]
settings_panels = [<wagtail.models.panels.PanelPlaceholder object>, <wagtail.models.panels.CommentPanelPlaceholder object>, <MultiFieldPanel with model=None>, <MultiFieldPanel with model=None>]
show_in_menus = False
subpage_types = []
subtitle

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

template = 'article/article_page.html'
word_file

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
class eucrim.article.models.ArticlePageAuthor(id, sort_order, page, author)[source]

Bases: Orderable

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

author

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.

author_id
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>
page

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.

page_id
panels = [<FieldPanel 'author' with model=None>]
sort_order

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

class eucrim.article.models.ArticlePageManager(*args, **kwargs)[source]

Bases: BasePageManagerFromPageQuerySet

get_queryset()[source]

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

with_prefetched_authors()[source]

Bases: Orderable, RelatedLink

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

id

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

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.

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

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.

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

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.

page_id
sort_order

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.

eucrim.article.models.article_authors_prefetch()[source]

eucrim.article.utils module

eucrim.article.utils.export_bibtex(self)[source]
eucrim.article.utils.word2html(cleaned_data, page_id=None)[source]

eucrim.article.wagtail_hooks module

eucrim.article.wagtail_hooks.register_viewset()[source]

Module contents