(cls, blueprint)
| 310 | |
| 311 | @classmethod |
| 312 | def register_node_view(cls, blueprint): |
| 313 | cls.blueprint = blueprint |
| 314 | id_url, url = cls.get_node_urls() |
| 315 | |
| 316 | commands = cls.generate_ops() |
| 317 | |
| 318 | for c in commands: |
| 319 | cmd = c['cmd'].replace('.', '-') |
| 320 | if c['with_id']: |
| 321 | blueprint.add_url_rule( |
| 322 | '/{0}{1}'.format( |
| 323 | c['cmd'], id_url if c['req'] else url |
| 324 | ), |
| 325 | view_func=cls.as_view( |
| 326 | '{0}{1}'.format( |
| 327 | cmd, '_id' if c['req'] else '' |
| 328 | ), |
| 329 | cmd=c['cmd'] |
| 330 | ), |
| 331 | methods=c['methods'] |
| 332 | ) |
| 333 | else: |
| 334 | blueprint.add_url_rule( |
| 335 | '/{0}'.format(c['cmd']), |
| 336 | view_func=cls.as_view( |
| 337 | cmd, cmd=c['cmd'] |
| 338 | ), |
| 339 | methods=c['methods'] |
| 340 | ) |
| 341 | |
| 342 | def children(self, *args, **kwargs): |
| 343 | """Build a list of treeview nodes from the child nodes.""" |
no test coverage detected