equal
deleted
inserted
replaced
145 """creation view for an entity""" |
145 """creation view for an entity""" |
146 # at this point we know etype is a valid entity type, thanks to our |
146 # at this point we know etype is a valid entity type, thanks to our |
147 # selector |
147 # selector |
148 etype = kwargs.pop('etype', self._cw.form.get('etype')) |
148 etype = kwargs.pop('etype', self._cw.form.get('etype')) |
149 entity = self._cw.vreg['etypes'].etype_class(etype)(self._cw) |
149 entity = self._cw.vreg['etypes'].etype_class(etype)(self._cw) |
150 entity.eid = self._cw.varmaker.next() |
150 entity.eid = next(self._cw.varmaker) |
151 self.render_form(entity) |
151 self.render_form(entity) |
152 |
152 |
153 def form_title(self, entity): |
153 def form_title(self, entity): |
154 """the form view title""" |
154 """the form view title""" |
155 if '__linkto' in self._cw.form: |
155 if '__linkto' in self._cw.form: |
197 # make a copy of entity to avoid altering the entity in the |
197 # make a copy of entity to avoid altering the entity in the |
198 # request's cache. |
198 # request's cache. |
199 entity.complete() |
199 entity.complete() |
200 self.newentity = copy(entity) |
200 self.newentity = copy(entity) |
201 self.copying = entity |
201 self.copying = entity |
202 self.newentity.eid = self._cw.varmaker.next() |
202 self.newentity.eid = next(self._cw.varmaker) |
203 self.w(u'<script type="text/javascript">updateMessage("%s");</script>\n' |
203 self.w(u'<script type="text/javascript">updateMessage("%s");</script>\n' |
204 % self._cw._(self.warning_message)) |
204 % self._cw._(self.warning_message)) |
205 super(CopyFormView, self).render_form(self.newentity) |
205 super(CopyFormView, self).render_form(self.newentity) |
206 del self.newentity |
206 del self.newentity |
207 |
207 |