Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
3145 Ansichten

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

 

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
3
Sept. 18
5653
0
Feb. 16
3720
0
Aug. 15
5553
1
März 15
579
3
März 15
534