FeinCMS 1.6 release notes¶
Welcome to FeinCMS 1.6!
Backwards-incompatible changes¶
Reversing application content URLs¶
The default value of FEINCMS_REVERSE_MONKEY_PATCH has been changed to
False. Support for monkey-patching the reverse() method to support
the old 'urlconf/viewname' notation will be removed in the 1.7 release.
Improvements to the bundled file and image contents¶
ImageContent,FileContentandVideoContentnow have pretty icons out-of-the-box.ImageContentnow accepts optionalFORMAT_CHOICESfor use with FeinCMS’ bundled thumbnailers, as well ascaptionandalt_textfields.Note
If you are upgrading from an earlier version of FeinCMS, you’ll have to add the new database columns yourself or use a migration tool like South to do it for you. Instructions for MySQL and the page module follow:
ALTER TABLE page_page_imagecontent ADD COLUMN `alt_text` varchar(255) NOT NULL; ALTER TABLE page_page_imagecontent ADD COLUMN `caption` varchar(255) NOT NULL;
If you want to use
FORMAT_CHOICES:ALTER TABLE page_page_imagecontent ADD COLUMN `format` varchar(64) NOT NULL;
FileContentnow displays the size of the file in the default template, and usesspanelements to allow styling of the title / size.
Removal of deprecated features¶
- Deprecated page manager methods have been removed. You should use
Page.objects.for_requestinstead of the following manager methods:Page.objects.page_for_path_or_404()Page.objects.for_request_or_404()Page.objects.best_match_for_request()Page.objects.from_request()
- Deprecated page methods have been removed:
Page.active_children(): UsePage.children.active()instead.Page.active_children_in_navigation(): UsePage.children.in_navigation()instead.Page.get_siblings_and_self(): You probably wantedself.parent.children.active()orself.get_siblings(include_self=True).active()anyway.
- The shortcuts
Page.register_request_processors()andPage.register_response_processors()to register several request or response processors at once have been removed in favor of their counterparts which only allow one processor at a time, but allow for replacing FeinCMS’ included processors,require_path_active_request_processorandredirect_request_processor. - It is not possible anymore to access the request and response processors as
methods of the
Pageclass. The processors are all infeincms.module.page.processorsnow. - The deprecated support for prefilled attributes has been removed. Use
Django’s own
prefetch_relatedorfeincms.utils.queryset_transforminstead. - The deprecated
feincms.views.basemodule has been removed. The code has been moved tofeincms.views.legacyduring the FeinCMS v1.5 cycle.
New deprecations¶
- The view decorator
feincms.views.decorators.add_page_to_extra_contexthas been deprecated as it was mostly used with function-based generic views, which have been deprecated in Django as well. Use Django’s class-based generic views and thefeincms.context_processors.add_page_if_missingcontext processor if you need similar functionality instead. - The content type
feincms.content.medialibrary.models.MediaFileContenthas been deprecated since FeinCMS v1.4. The whole module has been deprecated now and will be replaced with the contents offeincms.content.medialibrary.v2in FeinCMS v1.7. Thev2module will stay around for another release or two so that code usingv2will continue working with FeinCMS v1.8 (at least). - The template tag
feincms_navigationhas been superseded byfeincms_navwhich fixes a few problems with the old code and is generally much more maintainable. The old version will stay around for one more version and will be removed for FeinCMS v1.8. The only difference (apart from the bugfixes and the slightly different syntax) is thatfeincms_navunconditionally uses navigation extensions. Additionally,feincms_navigationusesfeincms_nav‘s implementation behind the scenes, which means that theextendedargument does not have an effect anymore (it’s always active). - The HTML cleaning support in
feincms.utils.html.cleansewhich could be easily used in theRichTextContentby passingcleanse=Truehas been copied into its own Python package, feincms-cleanse. You should start passing a callable tocleanseright now. The existing support for cleansing will only be available up to FeinCMS v1.7. - FeinCMS v1.8 will not support shorthands anymore when registering extensions.
Always provide the full python path to the extension file (or pass callables)
to
feincms.models.Base.register_extensions. That is,Page.register_extensions('feincms.module.extensions.ct_tracker')should be used instead ofPage.register_extensions('ct_tracker'). While it is a bit more work it will make it much more explicit what’s going on.
Compatibility with Django and other apps¶
FeinCMS 1.6 requires Django 1.4. If you want to use django-reversion with FeinCMS you have to use django-reversion 1.6 or newer.
Notable features and improvements¶
- The bundled content types take additional steps to ensure that the main view
context is available in content types’ templates. If you only use the rendering
tags (
feincms_render_regionandfeincms_render_content) you can take advantage of all variables from your context processors in content types’ templates too. Furthermore, those templatetags have been simplified by using Django’stemplate.Library.simple_tagmethod now, which means that filters etc. are supported as template tag arguments now. MediaFiledoes no longer auto-rotate images on upload. It really is not a media library’s job to magically modify user content; if needed, it should be done in an image filter (like sorl). Also, reading through the image data seems to have a side effect on some external storage engines which then would only save half the image data, see issue #254. Additionally, FeinCMS does not try anymore to detect whether uploaded files really are images, and only looks at the file extension by default. We did not peek at the contents of other file types either.- A new model field has been added,
feincms.contrib.richtext.RichTextField. This is a drop-in replacement for Django’smodels.TextFieldwith the difference that it adds the CSS classes required by rich text fields in the item editor. - The value of
FEINCMS_FRONTEND_EDITINGdefaults toFalsenow. - Frontend editing can now safely be used with caching. This is accomplished by saving state in a cookie instead of creating sessions all the time.
- The
SectionContentcontent type has been updated and does properly useraw_id_fieldsfor the media files instead of the hack which was used before. - It is now possible to specify a different function for generating thumbnails
in the media library administration. Set the setting
FEINCMS_MEDIALIBRARY_THUMBNAILto a function taking a media file instance and returning a URL to a thumbnail image or nothing if the file type cannot be handled by the thumbnailer. - Thumbnails generated by the bundled
|thumbnailand|cropscaletemplate filters are stored separately from the uploaded files now. This change means that all thumbnails will be automatically regenerated after a FeinCMS update. If you need the old behavior for some reason, set the settingFEINCMS_THUMBNAIL_DIRto an empty string. The default setting is'_thumbs/'. - All templates and examples have been converted to the new
{% url %}syntax. - Custom comment models are now supported in the
CommentsContent. - Media files are now removed from the disk too if a media file entry is removed from the database.
- The modules
feincms.module.page.modelsandfeincms.module.medialibrary.modelshave been split up. Admin code has been moved intomodeladmin.pyfiles, form code intoforms.py.
Bugfixes¶
- The core page methods support running with
APPEND_SLASH = Falsenow. Many content types using forms do not, however. - The MPTT attributes aren’t hardcoded in the tree editor anymore. Custom names
for the
left,right,levelandtree_idattributes are now supported. Models which do not useidas their primary key are supported now as well. - FeinCMS uses timezone-aware datetimes now.