コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3137 ビュー

i want to inherit the class html and to redefine the methode _symbol_f(x) which is defined in osv/fields.py in html classe the definition of this calss is the following:

class text(_column):

_type = 'text'

 

class html(text):

_type = 'html'

_symbol_c = '%s'

def _symbol_f(x):

        if x is None or x == False:

            return None

return html_sanitize(x)

_symbol_set = (_symbol_c, _symbol_f)

i want to redefine the method _symbol_f(x), so i have created the class wiki_html in the file wiki_html.py like the following

from openerp.osv import fields, osv

class wiki_html(fields.html):

_type = 'html'

_symbol_c = '%s'

def _symbol_f(x):

if x is None or x == False:

        return None

return html_sanitize_h(x)

_symbol_set = (_symbol_c, _symbol_f)

and now i define a field like the following:

'demandes_description':wiki_html('Description demande'),

but i have always this error:

openerp.osv.orm: <class 'openerp.addons.....wiki_html'> type not supported!

please help !!

 

アバター
破棄
関連投稿 返信 ビュー 活動
3
9月 18
5644
0
2月 16
3720
0
8月 15
5547
1
3月 15
558
3
3月 15
533