stop automatically setting default method for _format field, too hard to override this with the new form system while keeping bw compat. Simply upgrade to new form system where it's a problem stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 19 May 2009 09:05:47 +0200
branchstable
changeset 1854 9302d0e66076
parent 1853 b1e3d8355d65
child 1855 4e2eeb88780f
stop automatically setting default method for _format field, too hard to override this with the new form system while keeping bw compat. Simply upgrade to new form system where it's a problem
entities/__init__.py
--- a/entities/__init__.py	Mon May 18 19:50:54 2009 +0200
+++ b/entities/__init__.py	Tue May 19 09:05:47 2009 +0200
@@ -57,16 +57,6 @@
             return '%s DESC' % var
         return None
 
-    @classmethod
-    def __initialize__(cls):
-        super(ANYENTITY, cls).__initialize__() # XXX
-        # set a default_ATTR method for rich text format fields
-        # XXX move this away once the old widgets have been dropped!
-        eschema = cls.e_schema
-        for metaattr, (metadata, attr) in eschema.meta_attributes().iteritems():
-            if metadata == 'format' and not hasattr(cls, 'default_%s' % metaattr):
-                setattr(cls, 'default_%s' % metaattr, cls._default_format)
-
     # meta data api ###########################################################
 
     def dc_title(self):
@@ -269,9 +259,6 @@
         from cubicweb.web.views.autoform import AutomaticEntityForm
         return AutomaticEntityForm.esrelations_by_category(self, categories, permission)
 
-    def _default_format(self):
-        return self.req.property_value('ui.default-text-format')
-
     def attribute_values(self, attrname):
         if self.has_eid() or attrname in self:
             try: