Skip to Content
Menu
This question has been flagged
3138 Rodiniai

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 !!

 

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
3
rugs. 18
5647
0
vas. 16
3720
0
rugp. 15
5548
1
kov. 15
564
3
kov. 15
533