eucrim.news package
Submodules
eucrim.news.apps module
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']
- 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:
BasePageManagerFromPageQuerySetCustom sorting for all news
- class eucrim.news.models.FeaturedNewsManager(*args, **kwargs)[source]
Bases:
DefaultNewsManagerCustom manager for featured news
- 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
- 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.commentsis 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.placeis aForwardOneToOneDescriptorinstance.
- 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>]
- 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
- 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>
- property get_all_categories
- property get_backlinks
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.commentsis a ReverseGenericManyToOneDescriptor instance.
- is_creatable = True
- is_featured_news
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.parentis aForwardManyToOneDescriptorinstance.
- 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.placeis aForwardOneToOneDescriptorinstance.
- 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.
- save(*args, **kwargs)[source]
In case
publication_dateis not set or is 1970-01-01 (our import default value), setpublication_datetofirst_published_atdate. This ensures we could usepublication_datefor 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'
- class eucrim.news.models.NewsPageRelatedLink(id, sort_order, link_external, link_page, link_document, title, page)[source]
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.
- link_document
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.parentis aForwardManyToOneDescriptorinstance.
- link_document_id
- link_external
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- link_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.parentis aForwardManyToOneDescriptorinstance.
- link_page_id
- 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.parentis aForwardManyToOneDescriptorinstance.
- 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:
DefaultNewsManagerCustom manager for standard news