(self, request: Request, value: Any)
| 133 | return await self.model.all() |
| 134 | |
| 135 | async def render(self, request: Request, value: Any): |
| 136 | options = await self.get_options() |
| 137 | selected = list(map(lambda x: x.pk, value.related_objects if value else [])) |
| 138 | for option in options: |
| 139 | if option.get("value") in selected: |
| 140 | option["selected"] = True |
| 141 | self.context.update(options=json.dumps(options)) |
| 142 | return await super(Input, self).render(request, value) |
| 143 | |
| 144 | |
| 145 | class Enum(Select): |
nothing calls this directly
no test coverage detected