Is your feature request related to a problem? Please describe.
Currently, each command execution is stored independently in the Command model, but there is no relationship between individual command executions and the mass operation that triggered them.
With the introduction of mass command execution, multiple Command objects will be created as part of a single MassCommand operation. Without an explicit relationship between these models, it would not be possible to identify from the device command history whether a command was executed individually or as part of a mass operation.
Describe the solution I would implement
I would like to add a relationship between Command and MassCommand by introducing a nullable foreign key in AbstractCommand.
mass_command = models.ForeignKey(
get_model_name("connection", "MassCommand"),
null=True,
blank=True,
on_delete=models.SET_NULL,
)
- Add a nullable mass_command foreign key field to AbstractCommand so that commands created as part of a batch operation can reference their parent MassCommand.
- Commands executed individually through the existing single-device workflow will continue to have this field set to NULL.
- On the device detail page, the command history should indicate whether a command was executed as part of a mass operation.
- If a command belongs to a MassCommand, the UI should provide a link to the corresponding mass command execution result page, allowing administrators to navigate directly to the parent batch operation.
Is your feature request related to a problem? Please describe.
Currently, each command execution is stored independently in the Command model, but there is no relationship between individual command executions and the mass operation that triggered them.
With the introduction of mass command execution, multiple Command objects will be created as part of a single MassCommand operation. Without an explicit relationship between these models, it would not be possible to identify from the device command history whether a command was executed individually or as part of a mass operation.
Describe the solution I would implement
I would like to add a relationship between Command and MassCommand by introducing a nullable foreign key in AbstractCommand.