eucrim.news package

Submodules

eucrim.news.apps module

class eucrim.news.apps.NewsConfig(app_name, app_module)[source]

Bases: AppConfig

name = 'eucrim.news'

eucrim.news.filters module

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

Bases: FilterSet

class Meta[source]

Bases: object

fields = ['news_type', 'is_featured_news', 'categories_region', 'categories_foundation', 'categories_institution', 'categories_cooperation', 'categories_areacrime', 'categories_procedural']
model

alias of NewsPage

base_filters = {'categories_areacrime': <django_filters.filters.ModelMultipleChoiceFilter object>, 'categories_cooperation': <django_filters.filters.ModelMultipleChoiceFilter object>, 'categories_foundation': <django_filters.filters.ModelMultipleChoiceFilter object>, 'categories_institution': <django_filters.filters.ModelMultipleChoiceFilter object>, 'categories_procedural': <django_filters.filters.ModelMultipleChoiceFilter object>, 'categories_region': <django_filters.filters.ModelMultipleChoiceFilter object>, 'is_featured_news': <django_filters.filters.BooleanFilter object>, 'news_type': <django_filters.filters.MultipleChoiceFilter object>}
declared_filters = {'categories_areacrime': <django_filters.filters.ModelMultipleChoiceFilter object>, 'categories_cooperation': <django_filters.filters.ModelMultipleChoiceFilter object>, 'categories_foundation': <django_filters.filters.ModelMultipleChoiceFilter object>, 'categories_institution': <django_filters.filters.ModelMultipleChoiceFilter object>, 'categories_procedural': <django_filters.filters.ModelMultipleChoiceFilter object>, 'categories_region': <django_filters.filters.ModelMultipleChoiceFilter object>, 'is_featured_news': <django_filters.filters.BooleanFilter object>, 'news_type': <django_filters.filters.MultipleChoiceFilter object>}

eucrim.news.models module

class eucrim.news.models.DefaultNewsManager(*args, **kwargs)[source]

Bases: BasePageManagerFromPageQuerySet

Custom sorting for all news

get_queryset()[source]

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

class eucrim.news.models.FeaturedNewsManager(*args, **kwargs)[source]

Bases: DefaultNewsManager

Custom manager for featured news

get_queryset()[source]

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

class eucrim.news.models.NewsIndexPage(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_news_at)[source]

Bases: RoutablePageMixin, Page

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: NotUpdated

ajax_template = None
filternews(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_news_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']
promote_panels = [<MultiFieldPanel with model=None>]
settings_panels = [<wagtail.models.panels.PanelPlaceholder object>, <wagtail.models.panels.CommentPanelPlaceholder object>, <FieldPanel 'paginate_news_at' with model=None>]
show_in_menus = True
subpage_types = ['NewsPage']
template = 'news/news_index_page.html'
class eucrim.news.models.NewsPage(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, news_type, is_featured_news, language, issue, issue_page_from, issue_page_to, publication_date, subtitle, body, excerpt, category_news_export)[source]

Bases: HideShowInMenusField, AbstractPublicationPage

CATEGORY_FIELDS = {'Area of crime': 'categories_areacrime', 'Cooperation': 'categories_cooperation', 'Foundation': 'categories_foundation', 'Institution': 'categories_institution', 'Procedural': 'categories_procedural', 'Region': 'categories_region'}
exception DoesNotExist

Bases: ObjectDoesNotExist

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

Bases: MultipleObjectsReturned

NEWS = 'NW'
NEWS_TYPE_CHOICES = (('NW', 'News'), ('RP', 'Report'))
exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

REPORT = 'RP'
ajax_template = None
arcana_markdown()[source]
authors
authors_panels = [<FieldPanel 'authors' with model=None>]
body

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

categories_areacrime
categories_cooperation
categories_foundation
categories_institution
categories_procedural
categories_region
category_news_export

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

content_panels = [<wagtail.models.panels.PanelPlaceholder object>, <MultiFieldPanel with model=None>, <MultiFieldPanel with model=None>]
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.

featurednews_objects = <eucrim.news.models.FeaturedNewsManager object>
get_absolute_url()[source]

Get_absolute_url, needed by syndication framework, see feeds.py

property get_all_categories
get_all_categories_static()[source]

Get related_links from other NewsPages pointing to this NewsPage but only get backlink if not already present as a related link.

property get_body_with_author
get_category_news_export_display(*, field=<django.db.models.fields.CharField: category_news_export>)
property get_category_news_export_label

Reverse the slugified category_news_export field to a human readable: category_news_export=’area-of-crime—cybercrime’ -> ‘Area of crime / Cybercrime’

get_language_display(*, field=<django.db.models.fields.CharField: language>)
get_news_type_display(*, field=<django.db.models.fields.CharField: news_type>)
property get_obj_og_description
property has_been_modified
property has_categories
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

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

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.

property news_index_page
news_type

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

objects = <eucrim.news.models.DefaultNewsManager 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 = ['news.NewsIndexPage']
publication_date

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

related_panels = [<FieldPanel 'category_news_export' with model=None>, <MultiFieldPanel with model=None>, <InlinePanel with model=None>]
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>, <AutocompleteField: subtitle>, <AutocompleteField: body>, <AutocompleteField: excerpt>]
settings_panels = [<wagtail.models.panels.PanelPlaceholder object>, <wagtail.models.panels.CommentPanelPlaceholder object>, <FieldPanel 'news_type' with model=None>, <FieldPanel 'publication_date' with model=None>, <FieldPanel 'is_featured_news' with model=None>]
standardnews_objects = <eucrim.news.models.StandardNewsManager object>
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 = 'news/news_page.html'

Bases: RelatedLinkMixin, 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.

class eucrim.news.models.StandardNewsManager(*args, **kwargs)[source]

Bases: DefaultNewsManager

Custom manager for standard news

get_queryset()[source]

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

eucrim.news.wagtail_hooks module

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

Module contents