# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1239189273 -7200 # Node ID 824f695ab344872031acabda8c2834d30d403a13 # Parent 5eff2ef9297722f5401344e9463a71c2a898eab7 kill old inlined forms code, only overriden in metastock (dead) and vcsfile (has to be updated anyway) diff -r 5eff2ef92977 -r 824f695ab344 web/views/baseforms.py --- a/web/views/baseforms.py Wed Apr 08 13:13:53 2009 +0200 +++ b/web/views/baseforms.py Wed Apr 08 13:14:33 2009 +0200 @@ -455,96 +455,6 @@ } ctx.update(local_ctx) return ctx - - -class InlineEntityCreationForm(InlineFormMixIn, CreationForm): - id = 'inline-creation' - __select__ = (match_kwargs('ptype', 'peid', 'rtype') - & specified_etype_implements('Any')) - - EDITION_BODY = u'''\ -
-
-
%(title)s #1 [%(removemsg)s]
-
- %(attrform)s - %(relattrform)s -
-
- -
''' # do not insert trailing space or \n here ! - - def call(self, etype, ptype, peid, rtype, role='subject', **kwargs): - """ - :param etype: the entity type being created in the inline form - :param parent: the parent entity hosting the inline form - :param rtype: the relation bridging `etype` and `parent` - :param role: the role played by the `parent` in the relation - """ - try: - entity = self.vreg.etype_class(etype)(self.req, None, None) - except: - self.w(self.req._('no such entity type %s') % etype) - return - self.edit_form(entity, ptype, peid, rtype, role, **kwargs) - - -class InlineEntityEditionForm(InlineFormMixIn, EditionForm): - id = 'inline-edition' - __select__ = non_final_entity() & match_kwargs('ptype', 'peid', 'rtype') - - EDITION_BODY = u'''\ -
-
%(notice)s
-
%(title)s #%(count)s [%(removemsg)s]
-
-
- %(attrform)s -
- %(relattrform)s -
-
-%(base)s - - %(rinput)s -
-
''' # do not insert trailing space or \n here ! - - rel_input = u'''''' - - def call(self, **kwargs): - """redefine default View.call() method to avoid automatic - insertions of
between each row of - the resultset - """ - rset = self.rset - for i in xrange(len(rset)): - self.wview(self.id, rset, row=i, **kwargs) - - def cell_call(self, row, col, ptype, peid, rtype, role='subject', **kwargs): - """ - :param parent: the parent entity hosting the inline form - :param rtype: the relation bridging `etype` and `parent` - :param role: the role played by the `parent` in the relation - """ - entity = self.entity(row, col) - self.edit_form(entity, ptype, peid, rtype, role, **kwargs) - - - def form_context(self, entity, kwargs): - ctx = super(InlineEntityEditionForm, self).form_context(entity, kwargs) - if self.keep_entity(entity): - ctx['rinput'] = self.rel_input % ctx - ctx['todelete'] = u'' - else: - ctx['rinput'] = u'' - ctx['todelete'] = u'checked="checked"' - ctx['count'] = entity.row + 1 - return ctx class CopyEditionForm(EditionForm):