diff --git a/addons/pad/pad.py b/addons/pad/pad.py index 40569fcd589..3431e196b59 100644 --- a/addons/pad/pad.py +++ b/addons/pad/pad.py @@ -8,6 +8,11 @@ from tools.translate import _ class pad_common(osv.osv_memory): _name = 'pad.common' _pad_fields = [] + + def pad_content(self, cr, uid, url ,context=None): + content = urllib2.urlopen('%s/export/html'%url).read() + return content + def pad_generate_url(self, cr, uid, context=None): pad_url_template = self.pool.get('res.users').browse(cr,uid, uid, context).company_id.pad_url_template s = string.ascii_uppercase + string.digits @@ -20,6 +25,13 @@ class pad_common(osv.osv_memory): url = pad_url_template % template_vars return url + # TODO + # add attribute on columns pad_content_field = + # override default write to load the content at write and store it in the field + # reverse engineer protocol to be setHtml without using the api key + # override default get to generate urls + # override read to generate url and store the content if empty + def copy(self, cr, uid, id, default=None, context=None): if not default: default = {}