Create an agenda on top of djangocms-blog!
Project description
Add an Agenda to your blog that displays upcoming events!
Easy! CheapFree! Not seen on TV!
Install
-
Install the package
python3 -m pip install djangocms-blog-agenda
-
Add it in your
INSTALLED_APPS:"djangocms_blog_agenda", "recurrence",
-
Run the migration:
python3 manage.py migrate djangocms_blog_agenda
-
Update the
djangocms-blogurls by the ones in this module, by using this lovely setting:BLOG_URLCONF = "djangocms_blog_agenda.patched_urls"
-
Create a new blog configuration.
- Instance namespace: put what you want.
- Application title: put what you want.
- Object name: put what you want.
- [...]
- Click on Layout (Show):
- [...]
- Template prefix:
djangocms_blog_agenda.
That's very important since this application will check this value multiple times (to update the queryset, to check the templates, to add the post extension "event date" only to the Agenda app...).
- Save this config.
-
Explanations/Views/Misc
- A new
Event dateDateTime field has been added to blog posts that have the template prefix set todjangocms_blog_agenda. - A new post list view was created for the Agenda view, it includes all the posts where the
event_dateis set to a date in the future. - Another view is available at
_("/past/"), that will display each post where theevent_dateis in the past. - The templates are not in
djangocms_blog/templatesanymore, but indjangocms_blog_agenda/templates. Something's not appearing on your templates? Try to edit the file indjangocms_blog_agenda/templates/! - We removed the mention of comments & liveblog in the admin form, because we're not using this.
- We use some very special bits of code that are using some internal features of djangocms-blog (see
misc.py, andapps.py). Try the module before pushing an update.
Config
Settings
DJANGOCMS_BLOG_AGENDA_HIDE_UPCOMING_EVENTS_AFTER_CHOICES
a tuple of choices describing when AgendaUpcomingEntriesPlugin will hide events.
Default choices are:
(
("start", _("just after event start date")),
("start+1h", _("1 hour after event start date")),
("start+4h", _("4 hours after event start date")),
("start+1d", _("1 day after event start date")),
("start+2d", _("2 days after event start date")),
("start+3d", _("3 days after event start date")),
("start+7d", _("7 days after event start date")),
("end", _("just after event end date")),
)
DJANGOCMS_BLOG_AGENDA_RECURRENCE_MAX_DAYS_SEARCH
a number of days (int) to limit the search of recurring events. Defaults to 365.
Multisite
This modules handles multisite just fine; just add BLOG_MULTISITE = True in your settings, and our module will inject the get_site function directly inside the class returned by get_user_model()! (it is done in AppConfig ready() method)
You will then need to create a new "Global Page Permission" entry with your user/group, and to select the site where the user/group will have the right to post new articles/agenda posts.
If you're curious about this function, here it is.
Recurrences
Recurring events are handled with the help of django-recurrence package. Only the first event is saved into database, and following recurring events are added into querysets just before they are displayed. Only events that occurs n days after the first event are displayed. You can change this n with the setting DJANGOCMS_BLOG_AGENDA_RECURRENCE_MAX_DAYS_SEARCH.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file djangocms_blog_agenda-0.9.3.tar.gz.
File metadata
- Download URL: djangocms_blog_agenda-0.9.3.tar.gz
- Upload date:
- Size: 34.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9793607ca386f8bb067873d22debacd7b67d828e6da42243ce6b8aad4799729
|
|
| MD5 |
bf8fb99615deffdca73718cf88cd1af7
|
|
| BLAKE2b-256 |
39a63cba5e87b16c0a69210f4e32192295d1676f4cde3a24ff7f39191e27b69d
|
File details
Details for the file djangocms_blog_agenda-0.9.3-py3-none-any.whl.
File metadata
- Download URL: djangocms_blog_agenda-0.9.3-py3-none-any.whl
- Upload date:
- Size: 42.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2233e02508639215e40d47a0327e8b610e5c538790e599653459c86ba42e3e99
|
|
| MD5 |
0b4181bbbf1ed9a3fa560c2c09b6f588
|
|
| BLAKE2b-256 |
254c9da037739bbd94c95e16e3b0a5264996ce5e5c049220019ad40b6a841b78
|