Manage opening hours with ease!
Install
- Add this in your
INSTALLED_APPS:"nested_admin", "opening_hours_management",
Use
- Import module in your models.py:
from opening_hours_management.models import OpeningHours
- Add your opening attribute in your model:
opening = models.OneToOneField( OpeningHours, verbose_name=_("Opening hours"), on_delete=models.SET_NULL, null=True, )
- Run
makemigrationsandmigrate. - Add this on your template file:
{% load opening_hours_management %} {% show_opening_hours object.opening <True/False> %}Hereobject.openingis ourOpeningHoursOneToOne, andTrue/Falseis a condition that makes the templatetag displays special openings/closings that have already occurred. It defaults toFalseif not present (example).
Screenshot
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)
| 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
|