-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: better View class use and fix typo
- Loading branch information
1 parent
af271b2
commit a1267ef
Showing
5 changed files
with
46 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
from extras.plugins import PluginTemplateExtension | ||
|
||
|
||
class DecommisioningBase(PluginTemplateExtension): | ||
class DecommissioningBase(PluginTemplateExtension): | ||
def buttons(self): | ||
return ( | ||
f'<a href="/plugins/cmdb/decommisioning/{self.obj}/{self.context["object"].id}/delete" ' | ||
f'<a href="/plugins/cmdb/decommissioning/{self.obj}/{self.context["object"].id}/delete" ' | ||
'class="btn btn-sm btn-danger">Decommission</a>' | ||
) | ||
|
||
|
||
class DeviceDecommisioning(DecommisioningBase): | ||
class DeviceDecommissioning(DecommissioningBase): | ||
model = "dcim.device" | ||
obj = "device" | ||
|
||
|
||
class SiteDecommisioning(DecommisioningBase): | ||
class SiteDecommissioning(DecommissioningBase): | ||
model = "dcim.site" | ||
obj = "site" | ||
|
||
|
||
template_extensions = [DeviceDecommisioning, SiteDecommisioning] | ||
template_extensions = [DeviceDecommissioning, SiteDecommissioning] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters