Menu:

How to update your old Plugins

Here you can find information, how to update your old PyLucid Plugins (from v0.7.x to v0.8.x).

Some things has been changed, but many things works similar.

Examples of changes in a updated plugin:

update the internal pages

All internal pages are now stored into a sub directory named 'internal_pages'.

The django template engine is similar to the jinja engine. But some things works in a other way. First, you can use the update function:

Then you can update in a try-error way. Look at these page:

The best way to change your internal page template: Edit the files and use the 'reinit' function in the Plugin Administration!

Plugins

config file

In the config file there are a few things changed:

API

Base class to inherit

PyLucid.system.BaseModule.PyLucidBaseModule -> PyLucid.system.BasePlugin.PyLucidBasePlugin
Now it works like this:

Python
1
2
3
from PyLucid.system.BasePlugin import PyLucidBasePlugin

class MyPluginClass(PyLucidBasePlugin):
self.URLs

Many methods are deleted or renamed from this object:

database access

The own PyLucid database wrapper is gone a way. But that not a real problem. The django ORM is great! Please read the documentation about this here:

access to POST, GET data

old:

Python
1
txt1 = self.request.form["txt1"]

new:

Python
1
txt1 = self.request.POST["txt1"]

It is recommended to use newforms: http://www.djangoproject.com/documentation/newforms/

See also