Date
1 - 1 of 1
Is there a way to dynamically add forms to the formset?
Konstantin Aladyshev
Hello!
Is there a way to dynamically add forms to the formset?
Usually dynamic content is created with the help of a 'label' keyword.
But it looks like it is not possible to use it outside of the form.
My problem is this:
I want to create a driver that would dynamically show PCIe devices in
the system. So far I've created a form that lists the devices like
this:
```
PCIe device list
_______________________________________________________
00:00.00 - Vendor:8086, Device:1237 | Bridge Device
00:01.00 - Vendor:8086, Device:7000 | Host/PCI bridge
00:01.01 - Vendor:8086, Device:7010 |
00:01.03 - Vendor:8086, Device:7113 |
00:02.00 - Vendor:1234, Device:1111 |
Refresh PCIe device list
```
In this case, every device is just a 'text' element on the form. Now I
want to switch that to `goto`, so the user would be able to "enter"
each device individual form for the detailed description (PCIe
capabilities, etc.).
That is why I'm asking about the dynamic form adding. But maybe there
is a better way for this?
Best regards,
Konstantin Aladyshev
Is there a way to dynamically add forms to the formset?
Usually dynamic content is created with the help of a 'label' keyword.
But it looks like it is not possible to use it outside of the form.
My problem is this:
I want to create a driver that would dynamically show PCIe devices in
the system. So far I've created a form that lists the devices like
this:
```
PCIe device list
_______________________________________________________
00:00.00 - Vendor:8086, Device:1237 | Bridge Device
00:01.00 - Vendor:8086, Device:7000 | Host/PCI bridge
00:01.01 - Vendor:8086, Device:7010 |
00:01.03 - Vendor:8086, Device:7113 |
00:02.00 - Vendor:1234, Device:1111 |
Refresh PCIe device list
```
In this case, every device is just a 'text' element on the form. Now I
want to switch that to `goto`, so the user would be able to "enter"
each device individual form for the detailed description (PCIe
capabilities, etc.).
That is why I'm asking about the dynamic form adding. But maybe there
is a better way for this?
Best regards,
Konstantin Aladyshev