-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP - Add Software Notice Model and Views #408
base: next3.0
Are you sure you want to change the base?
Conversation
18fb8db
to
ccec30f
Compare
ccec30f
to
75f89c6
Compare
6083d64
to
4eadb61
Compare
NavMenuButton( | ||
link="plugins:nautobot_device_lifecycle_mgmt:softwarenotice_add", | ||
title="Add", | ||
icon_class="mdi mdi-plus-thick", | ||
button_class=ButtonColorChoices.GREEN, | ||
permissions=[ | ||
"nautobot_device_lifecycle_mgmt.add_softwarenotice", | ||
], | ||
), | ||
NavMenuButton( | ||
link="plugins:nautobot_device_lifecycle_mgmt:softwarenotice_import", | ||
title="Import", | ||
icon_class="mdi mdi-database-import-outline", | ||
button_class=ButtonColorChoices.BLUE, | ||
permissions=["nautobot_device_lifecycle_mgmt.add_softwarenotice"], | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Use
NavMenuAddButton
instead of a genericNavMenuButton
for the "Add" button. - In current core versions we don't have an
Import
button in most nav menu entries any more.
"""Table for SoftwareNotice list view.""" | ||
|
||
pk = ToggleColumn() | ||
id = tables.LinkColumn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LinkColumn
is deprecated in django-tables2, use a regular Column
with linkify=True
instead.
@@ -0,0 +1,68 @@ | |||
{% extends 'generic/object_detail.html' %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this version target Nautobot 2.4 as a minimum and use the UI Component Framework for this view instead of the below HTML?
|
||
<tr> | ||
<td>Release Date</td> | ||
<td>{% if object.software_version.release_date %} {{ object.software_version.release_date }} {% else %} — {% endif %}</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If unable to use the component framework, please at least make use of standard helper template tags like {{ object.software_version.release_date|placeholder }}
and {{ object.device_type|hyperlinked_object }}
software_version_id = django_filters.ModelMultipleChoiceFilter( | ||
field_name="software_version", | ||
queryset=SoftwareVersion.objects.all(), | ||
label="Software Version", | ||
) | ||
software_version = django_filters.ModelMultipleChoiceFilter( | ||
field_name="software_version", queryset=SoftwareVersion.objects.all(), label="Software Version" | ||
) | ||
software_version_version = django_filters.ModelMultipleChoiceFilter( | ||
field_name="software_version__version", | ||
queryset=SoftwareVersion.objects.all(), | ||
to_field_name="version", | ||
label="Software Version (String)", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can/should these three be consolidated into a single filter using NaturalKeyOrPKMultipleChoiceFilter
? Same comment on others below.
end_of_support__gte = django_filters.DateFilter(field_name="end_of_support", lookup_expr="gte") | ||
end_of_support__lte = django_filters.DateFilter(field_name="end_of_support", lookup_expr="lte") | ||
end_of_support__isnull = django_filters.BooleanFilter(field_name="end_of_support", lookup_expr="isnull") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these extensions not automatically added to a DateFilter
by core?
Adding “Software Notices” model. Like the Hardware Notices, this model will store additional dates for the Software Versions (End of Sale, End of SW Releases, End of Security Patches, End of Support). Optionally, a notice could store different dates per Device Type.