eucrim.issue package
Submodules
eucrim.issue.apps module
eucrim.issue.forms module
- class eucrim.issue.forms.IssueForm(data=None, files=None, parent_page=None, subscription=None, *args, **kwargs)[source]
Bases:
WagtailAdminPageFormOverride 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.
eucrim.issue.models module
- class eucrim.issue.models.IssueIndexPage(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, intro, wordcloud_stopwords)[source]
Bases:
RoutablePageMixin,Page- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- exception NotUpdated
Bases:
NotUpdated
- ajax_template = None
- content_panels = [<wagtail.models.panels.PanelPlaceholder object>, <FieldPanel 'intro' with model=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.
- intro
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_creatable = True
- issue_details(request, issue_pk)[source]
HTMX partial: article listing + wordcloud for a single issue.
- property issues
- 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
- parent_page_types = ['core.HomePage']
- promote_panels = [<MultiFieldPanel with model=None>]
- 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: intro>]
- settings_panels = [<wagtail.models.panels.PanelPlaceholder object>, <wagtail.models.panels.CommentPanelPlaceholder object>, <FieldPanel 'wordcloud_stopwords' with model=None>]
- subpage_types = ['IssuePage']
- template = 'issue/issue_index_page.html'
- wordcloud_stopwords
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class eucrim.issue.models.IssuePage(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, focus_en, focus_fr, focus_ge, year, issue_number, legacy_toc, pdf, cover_image, start_page_numbering_at)[source]
Bases:
BasePage- exception DoesNotExist
Bases:
ObjectDoesNotExist
- ISSUE_NUMBER_CHOICES = ((1, '01'), (2, '02'), (3, '03'), (4, '04'))
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- exception NotUpdated
Bases:
ObjectNotUpdated,DatabaseError
- YEAR_CHOICES = [(2029, 2029), (2028, 2028), (2027, 2027), (2026, 2026), (2025, 2025), (2024, 2024), (2023, 2023), (2022, 2022), (2021, 2021), (2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006)]
- ajax_template = None
- articles
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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- content_panels = [<MultiFieldPanel with model=None>, <FieldPanel 'pdf' with model=None>, <FieldPanel 'start_page_numbering_at' with model=None>, <FieldPanel 'legacy_toc' with model=None>]
- 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.parentis aForwardManyToOneDescriptorinstance.
- cover_image_id
- focus_en
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- focus_fr
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- focus_ge
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- full_clean(*args, **kwargs)[source]
Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model. Raise a ValidationError for any errors that occur.
- property get_articles
- get_issue_number_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: issue_number>)
- property get_obj_og_description
- property get_obj_og_image
- property get_obj_og_title
- property get_official_notation
- property get_official_notation_w_volume
- property get_volume
Calculate the volume number for a given year.
- Parameters:
year – The year for which to calculate the volume.
start_year – The year the journal started (default is 2006).
- Returns:
The volume number for the given year.
- property get_wordcloud
- get_year_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: year>)
- 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
- issue_number
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- legacy_toc
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- news
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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- objects = <eucrim.issue.models.IssuePageManager 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 = ['issue.IssueIndexPage']
- pdf
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)
- property pdf_file_size
Return size in bytes without leaving open handles.
- promote_panels = [<MultiFieldPanel with model=None>]
- public_objects = <eucrim.issue.models.PublicIssuePageManager object>
- save(*args, **kwargs)[source]
Writes the page to the database, performing additional housekeeping tasks to ensure data integrity:
locale,draft_titleandslugare set to default values if not provided, withslugbeing generated from the title with a suffix to ensure uniqueness within the parent page where necessaryThe
url_pathfield is set based on theslugand the parent pageIf the
slughas changed, theurl_pathof this page and all descendants is updated and a page_slug_changed signal is sent
New pages should be saved by passing the unsaved page instance to the
add_child()oradd_sibling()method of an existing page, which will correctly update the fields responsible for tracking the page’s location in the tree.If
clean=Falseis passed, the page is saved without validation. This is appropriate for updates that only change metadata such as latest_revision while keeping content and page location unchanged.If
clean=Trueis passed (the default), and the page haslive=Trueset, the page is validated usingfull_clean()before saving.If
clean=Trueis passed, and the page haslive=Falseset, only the title and slug fields are validated.
- 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: focus_en>, <SearchField: focus_fr>, <SearchField: focus_ge>, <SearchField: legacy_toc>]
- start_page_numbering_at
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- subpage_types = []
- template = 'issue/issue_page.html'
- year
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class eucrim.issue.models.IssuePageManager(*args, **kwargs)[source]
Bases:
BasePageManagerFromPageQuerySetCustom manager for Issue pages
eucrim.issue.storage module
eucrim.issue.utils module
- class eucrim.issue.utils.PDFExtractResult(title_en, title_fr, title_ge, legacy_toc, error)
Bases:
tuple- error
Alias for field number 4
- legacy_toc
Alias for field number 3
- title_en
Alias for field number 0
- title_fr
Alias for field number 1
- title_ge
Alias for field number 2