Skip to main content

# TODO: Write description

Project description

Manage opening hours with ease!

Install

  1. Add this in your INSTALLED_APPS:
    "nested_admin",
    "opening_hours_management",
    

Use

  1. Import module in your models.py:
    from opening_hours_management.models import OpeningHours
    
  2. Add your opening attribute in your model:
    opening = models.OneToOneField(
        OpeningHours,
        verbose_name=_("Opening hours"),
        on_delete=models.SET_NULL,
        null=True,
    )
    
  3. Run makemigrations and migrate.
  4. Add this on your template file:
    {% load opening_hours_management %}
    
    {% show_opening_hours object.opening <True/False> %}
    
    Here object.opening is our OpeningHours OneToOne, and True/False is a condition that makes the templatetag displays special openings/closings that have already occurred. It defaults to False if not present (example).
  5. That's all folks!

Screenshot

Screenshot of django-opening-hours-management

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-opening-hours-management-0.0.8.tar.gz (28.0 kB view details)

Uploaded Source

File details

Details for the file django-opening-hours-management-0.0.8.tar.gz.

File metadata

  • Download URL: django-opening-hours-management-0.0.8.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for django-opening-hours-management-0.0.8.tar.gz
Algorithm Hash digest
SHA256 ab47b427cdb237cb678c60851ae4d71c9fc2680b339d5094337c0029fc9f99a4
MD5 1d368de35cf95a1dbe66b3980691db27
BLAKE2b-256 bbd4b32c24a9f3ac79ff6ac4670a0412f8c1af3dab6ce9465a721e4fbe4c468e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page