equal
deleted
inserted
replaced
15 # |
15 # |
16 # You should have received a copy of the GNU Lesser General Public License along |
16 # You should have received a copy of the GNU Lesser General Public License along |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 """abstract form classes for CubicWeb web client""" |
18 """abstract form classes for CubicWeb web client""" |
19 |
19 |
20 |
|
21 from warnings import warn |
|
22 |
20 |
23 from six import add_metaclass |
21 from six import add_metaclass |
24 |
22 |
25 from logilab.common.decorators import iclassmethod |
23 from logilab.common.decorators import iclassmethod |
26 |
24 |
271 if field.eidparam and self.edited_entity.eid != self.form_valerror.eid: |
269 if field.eidparam and self.edited_entity.eid != self.form_valerror.eid: |
272 return None |
270 return None |
273 try: |
271 try: |
274 return self.form_valerror.errors.pop(field.role_name()) |
272 return self.form_valerror.errors.pop(field.role_name()) |
275 except KeyError: |
273 except KeyError: |
276 if field.role and field.name in self.form_valerror: |
274 pass |
277 warn('%s: errors key of attribute/relation should be suffixed by "-<role>"' |
|
278 % self.form_valerror.__class__, DeprecationWarning) |
|
279 return self.form_valerror.errors.pop(field.name) |
|
280 return None |
275 return None |
281 |
276 |
282 def remaining_errors(self): |
277 def remaining_errors(self): |
283 return sorted(self.form_valerror.errors.items()) |
278 return sorted(self.form_valerror.errors.items()) |