Skip to main content

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

Metadata

Release files for django-opening-hours-management 0.0.8

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-opening-hours-management 0.0.8
File Size Uploaded
django-opening-hours-management-0.0.8.tar.gz 28.0 kB Details

Release files / django-opening-hours-management-0.0.8.tar.gz

Download URL django-opening-hours-management-0.0.8.tar.gz
Size 28.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ab47b427cdb237cb678c60851ae4d71c9fc2680b339d5094337c0029fc9f99a4
BLAKE2b-256 checksum
How to use checksums
bbd4b32c24a9f3ac79ff6ac4670a0412f8c1af3dab6ce9465a721e4fbe4c468e
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.8 This release

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

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