Skip to main content
https://badge.fury.io/py/django-price-level.png https://travis-ci.org/PetrDlouhy/django-price-level.png?branch=master

Adds time limited price levels to your model class.

Documentation

The full documentation is at https://django-price-level.readthedocs.io.

Quickstart

Install django-price-level:

pip install django-price-level

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'price_level',
    ...
)

Configure in your settings the desired model:

from model_utils import Choices
PRICE_LEVEL_MODEL = 'your.Model'
PRICE_LEVEL_CATEGORY_CHOICES = Choices(('basic', _('Basic')), ('company', _('For companies')))
PRICE_LEVEL_CATEGORY_DEFAULT = 'basic'

Add author middleware in settings:

MIDDLEWARE_CLASSES = [
    ...
    'author.middlewares.AuthorDefaultBackendMiddleware',
    ...
 ]

Use Pricable behavioral mixin to your model:

from price_level.models import Pricable
class Model(Pricable, models.Model):
   ...

Now you can get current price for your category:

price_level = model.get_current_price_level(category='company')

Features

  • Adds PriceLevel models can be bound to your model class

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits

Tools used in rendering this package:

History

0.1.0 (2017-01-05)

  • First release on PyPI.

Metadata

Release files for django-price-level 1.0.0

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

Source distribution (sdist)

Source distribution for django-price-level 1.0.0
File Size Uploaded Provenance Actions
django-price-level-1.0.0.tar.gz 16.0 kB Without provenance Details for django-price-level-1.0.0.tar.gz

Release files / django-price-level-1.0.0.tar.gz

Download URL django-price-level-1.0.0.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c26dfb3358717974159cdc949e665cc18a42376311f960f71fa287988ded9963
BLAKE2b-256 checksum
How to use checksums
809dca63318b79bfe0791f68cc79d348e9359a8a44b780a662578dda97ea5358
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-price-level 1.0.0

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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