web/views/editviews.py
changeset 4045 f4a52abb6f4f
parent 4023 eae23c40627a
child 4161 4273f5094651
equal deleted inserted replaced
4044:3876c894e018 4045:f4a52abb6f4f
    78     __select__ = match_form_params('relation')
    78     __select__ = match_form_params('relation')
    79 
    79 
    80     def cell_call(self, row, col):
    80     def cell_call(self, row, col):
    81         entity = self.cw_rset.get_entity(row, col)
    81         entity = self.cw_rset.get_entity(row, col)
    82         relname, target = self._cw.form.get('relation').rsplit('_', 1)
    82         relname, target = self._cw.form.get('relation').rsplit('_', 1)
    83         rschema = self._cw.schema.rschema(relname)
    83         rschema = self._cw.vreg.schema.rschema(relname)
    84         hidden = 'hidden' in self._cw.form
    84         hidden = 'hidden' in self._cw.form
    85         is_cell = 'is_cell' in self._cw.form
    85         is_cell = 'is_cell' in self._cw.form
    86         self.w(self.build_unrelated_select_div(entity, rschema, target,
    86         self.w(self.build_unrelated_select_div(entity, rschema, target,
    87                                                is_cell=is_cell, hidden=hidden))
    87                                                is_cell=is_cell, hidden=hidden))
    88 
    88 
    99             etypes = '/'.join(sorted(etype.display_name(self._cw) for etype in targettypes))
    99             etypes = '/'.join(sorted(etype.display_name(self._cw) for etype in targettypes))
   100         etypes = cut(etypes, self._cw.property_value('navigation.short-line-size'))
   100         etypes = cut(etypes, self._cw.property_value('navigation.short-line-size'))
   101         options.append('<option>%s %s</option>' % (self._cw._('select a'), etypes))
   101         options.append('<option>%s %s</option>' % (self._cw._('select a'), etypes))
   102         options += self._get_select_options(entity, rschema, target)
   102         options += self._get_select_options(entity, rschema, target)
   103         options += self._get_search_options(entity, rschema, target, targettypes)
   103         options += self._get_search_options(entity, rschema, target, targettypes)
   104         if 'Basket' in self._cw.schema: # XXX
   104         if 'Basket' in self._cw.vreg.schema: # XXX
   105             options += self._get_basket_options(entity, rschema, target, targettypes)
   105             options += self._get_basket_options(entity, rschema, target, targettypes)
   106         relname, target = self._cw.form.get('relation').rsplit('_', 1)
   106         relname, target = self._cw.form.get('relation').rsplit('_', 1)
   107         return u"""\
   107         return u"""\
   108 <div class="%s" id="%s">
   108 <div class="%s" id="%s">
   109   <select id="%s" onchange="javascript: addPendingInsert(this.options[this.selectedIndex], %s, %s, '%s');">
   109   <select id="%s" onchange="javascript: addPendingInsert(this.options[this.selectedIndex], %s, %s, '%s');">