This repository has been archived by the owner on Apr 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
jkrajniak/django-snippets
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
1. select_related manager 2.ShowTime template tag Usage: 1. Define in settings dict TIME_BLOCK with names of block that has to be shown on certain time: TIME_BLOCK = { 'block1': { 'from_date': datetime.datetime(2012, 04, 28, 13, 48), 'to_date': datetime.datetime(2012, 04, 30, 13, 48), 'show': True } } 2. In template use it in such way: {% showtime block1 %} content that will be displayed between 2012-04-28 13:48 and 2012-04-30 13:48 {% else %} content that will be displayed before and after that time {% endshowtime %} There is also the possibility to do it in the reverse way by using option 'show'.
About
Some django snippets
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published