django-flatblocks is a Django library that allows users to edit certain parts of a web page, such as a help box, alongside the primary content. It serves as an alternative to django.contrib.flatpages.
Usage entails creating some instances of the flatblocks.models.FlatBlock model, which can then be loaded using the flatblock_tags templatetag-library. The text block can easily be displayed using the name 'page.info,' which can also be a template variable without the quotes. The flatblock_tags library offers an optional argument where the time in seconds that the block should be cached can be specified.
Flatblocks.views.edit is a feature that offers a simple front-end view to edit flatblocks on the current page. You can easily include it in your URLconf and create a flatblocks/edit.html template. It is essential to decorate it accordingly with the login_required decorator in your URLconf since by default, it doesn't perform any permission checking.
Flatblocks.views.edit offers some basic customization hooks via the keyword arguments that help in making custom edits to the view. The template_name argument allows you to specify the name of the template to use for rendering the view. The success_url argument allows the view to redirect to a specified URL after a successful edit. The modelform_class argument allows you to use a customized modelform class for flatblocks. The permission_check argument lets you specify a callback function for flatblock-specific permission checking. This callback function returns either False, which prompts the user to receive a 403 message, an instance of HttpResponse or other return values to proceed with allowing the permissions for the user editing the flatblock.
Version 0.3.3: N/A