FeinCMS 1.3 release notes¶
FeinCMS 1.3 includes many bugfixes and cleanups and a number of new features. The cleanups and features caused a few backwards incompatible changes. The upgrade path is outlined below.
Highlights¶
FeinCMS pages use the standard Django permalink mechanism inside the
get_absolute_urlimplementation. This means that you have to update the URL definition if you did not includefeincms.urlsdirectly.Change this:
url(r'^$|^(.*)/$', 'feincms.views.base.handler'),
to this:
url(r'', include('feincms.urls')),
Defining the URL patterns directly is still possible. Have a look at
feincms.urlsto find out how this should be done.FeinCMS requires at least Django 1.2 but already has support for Django 1.3 features such as staticfiles. The FeinCMS media file folder has been moved from
feincms/media/feincmstofeincms/static/feincms- if you usedjango.contrib.staticfileswith Django 1.3 (and you should!), FeinCMS’ media files for the administration interface will automatically be made available without any further work on your part.Content types can specify the media files (Javascript and CSS files) they need to work correctly. See Extra media for content types for information on how to use this in your own content types.
The content type loading process has been streamlined and requires much less database queries than before. The performance hit on sites with deep page hierarchies, inheritance and many regions is several times smaller than before.
The content type interface has been extended with two new methods, available for all content types which need it:
processis called before rendering pages and is guaranteed to receive the current request instance. Each and every content type (not only application contents as before) has the ability to return full HTTP responses which are returned directly to the user.finalizeis called after rendering and can be used to set HTTP headers and do other post-processing tasks. See Influencing request processing through a content type for more information.
(Backwards incompatible and other) Changes¶
The default
ContentProxyhas been rewritten to load all content type instances on initialization. The instances stay around for the full request-response cycle which allows us to remove many quasi-global variables (variables attached to therequestobject). The new initialization is much more efficient in terms of SQL queries needed; the implementation is contained inside theContentProxyclass and not distributed all over the place.The
ContactFormContenthas been updated to take advantage of the new content type interface where content types can influence the request-response cycle in more ways.The
ct_trackerextension has been rewritten to take advantage of the newContentProxyfeatures. This means that the format of_ct_inventorycould not be kept backwards compatible and has been changed. The inventory is versioned now, therefore upgrading should not require any action on your part.feincms_siteis not available in the context anymore. It was undocumented, mostly unused and badly named anyway. If you still need this functionality you should usedjango.contrib.sitesdirectly yourself.The
_feincms_appcontent_parametershas been folded into the_feincms_extra_contextattribute on the current request. Theappcontent_parameterstemplate tag is not necessary anymore (the content of_feincms_extra_contextis guaranteed to be available in the template context) and has been removed.In your appcontent code, change all references of
_feincms_appcontent_parametersto_feincms_extra_context, e.g.params = getattr(request, ‘_feincms_appcontent_parameters’, {})
becomes
params = getattr(request, ‘_feincms_extra_context’, {})
As part of the effort to reduce variables attached to the request object (acting as a replacement for global variables),
request.extra_pathhas been removed. The same information can be accessed viarequest._feincms_extra_context['extra_path'].The
feincms.views.applicationcontentmodule has been removed. The special casing it provided for application content-using pages aren’t necessary anymore.The page’s
get_absolute_urlmethod uses URL reversion for determining the URL of pages instead of returning_cached_url. This means that you need to modify your URLconf entries if you added them to your ownurls.pyinstead of includingfeincms.urls. Please make sure that you have two named URL patterns,feincms_homeandfeincms_handler:from feincms.views.base import handler urlpatterns = patterns('', # ... your patterns ... url(r'^$', handler, name='feincms_home'), url(r'^(.*)/$', handler, name='feincms_handler'), )
If you want the old behavior back, all you need to do is add the following code to your
settings.py:ABSOLUTE_URL_OVERRIDES = { 'page.page': lambda page: page._cached_url, }
The copy/replace and preview mechanisms never worked quite right. They were completely dropped from this release. If you still need the ability to create copies of objects, use the standard Django
ModelAdmin.save_asfeature.