[MOV] website_blog: module organization cleaning. Files have been moved accordingly to the new organization
we would like to impose in OpenERP addons :
- model-related files: in models directory
- data/demo files: in data directory
- renamed sexurity/website_mail.xml to website_blog.xml, to avoid confusing the module with website_mail
[CLEAN] website_blog: cleaned website templates
Cleaned options: tags, hide author name, ... and default values for those options. We decided
to display tags, but hide blog name. Default implementation is a single blog layout.
Fixed display without right column: should take all page width.
Updated template ids: option begin by opt_ to easily find them when grepping / searching.
[FIX] website_blog: fixed class name for tests, importing class that does not exist anymore in trunk (was changed)
bzr revid: tde@openerp.com-
20131011093913-qlkgqxvodlx41rnk
import logging
import os
import datetime
+import re
from sys import maxint
import psycopg2
-import slugify
import werkzeug
import werkzeug.exceptions
import werkzeug.utils
import werkzeug.wrappers
from PIL import Image
+try:
+ from slugify import slugify
+except ImportError:
+ def slugify(s, max_length=None):
+ spaceless = re.sub(r'\s+', '-', s)
+ specialless = re.sub(r'[^-_a-z0-9]', '', spaceless)
+ return specialless[:max_length]
+
import openerp
from openerp.addons.website.models import website
from openerp.addons.web import http
def pagenew(self, path, noredirect=NOPE):
module = 'website'
# completely arbitrary max_length
- idname = slugify.slugify(path, max_length=50)
+ idname = slugify(path, max_length=50)
request.cr.execute('SAVEPOINT pagenew')
imd = request.registry['ir.model.data']