Skip to main content

What is this?

This package allows Ella users to change default behavior of category listing pages. By default, each page has same number of objects (if there is enough of them).

Sometimes, this does not meet the site’s requirements. Very often, it is demanded, that first page should be somehow different, e.g. list one more article that is rendered in different style (like leading article). This is unfortunately not possible to do without hackish workarounds in default Ella.

How to use this

Setup is quite straightforward. First, install the package using pip or setuptools:

pip install ella-listingex

Add the app to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...,
    'ella_listingex',
    ...
)

Configure the ella_listingex to meet your requirements. Internally, this app works by using Ella’s CUSTOM_VIEWS override. This means that we are telling Ella to use our views instead of in-built ones. ella_listingex application redefines Ella’s ListContentType view to provide additional functionality. Therefore, we need to allow CUSTOM_VIEWS and set the VIEWS variable to the path of ella_listingex.views as shown below:

# Use custom views to support different number of items on the first and
# next pages of category listings.
CUSTOM_VIEWS = True
VIEWS = 'ella_listingex.views'

Next step is to set the pagination:

LISTINGEX_PAGINATE_BY = 10        # Default number of objects per page
LISTINGEX_FIRST_PAGE_COUNT = 11   # Number of objects on first page

The ella_listingex works on all category listings which are not blacklisted. If you need to turn the special behaviour off on some pages, use the LISTINGEX_BLACKLIST configuration option to provide list of regular expressions which will be matched against category’s tree_path attribute. If there is a match, the first page will be paginated normally:

LISTINGEX_BLACKLIST = (           # Blacklist categories, whose tree_path
    r'^blogs',                    # matches '^blogs'
)

Metadata

Release files for ella-listingex 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ella-listingex 0.2
File Size Uploaded Provenance
ella-listingex-0.2.tar.gz 5.2 kB Without provenance Details

Release files / ella-listingex-0.2.tar.gz

Download URL ella-listingex-0.2.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d56de6f588d40814441835396ac0979ce9278a991bdc5da5f8322d4e42ecb726
BLAKE2b-256 checksum
How to use checksums
b8fece4704abe31eae40c70aa0cd879721551aa6350297979f2b56fcb4012019
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for ella-listingex 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page