Return all labels (Label instances) for this control. If the control was surrounded by a tag, that will be the first label; all other labels, connected by 'for' and 'id', are in the order that appear in the HTML.
(self)
| 1291 | raise NotImplementedError() |
| 1292 | |
| 1293 | def get_labels(self): |
| 1294 | """Return all labels (Label instances) for this control. |
| 1295 | |
| 1296 | If the control was surrounded by a <label> tag, that will be the first |
| 1297 | label; all other labels, connected by 'for' and 'id', are in the order |
| 1298 | that appear in the HTML. |
| 1299 | |
| 1300 | """ |
| 1301 | res = [] |
| 1302 | if self._label: |
| 1303 | res.append(self._label) |
| 1304 | if self.id: |
| 1305 | res.extend(self._form._id_to_labels.get(self.id, ())) |
| 1306 | return res |
| 1307 | |
| 1308 | |
| 1309 | #--------------------------------------------------- |