Skip to content
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

lexicographical sorting order of device bays #243

Closed
Zanthras opened this issue Jul 8, 2016 · 6 comments
Closed

lexicographical sorting order of device bays #243

Zanthras opened this issue Jul 8, 2016 · 6 comments
Labels
type: feature Introduction of new functionality to the application

Comments

@Zanthras
Copy link
Contributor

Zanthras commented Jul 8, 2016

Minor issue but slightly annoying. If I create say a blade chassis container and add device bays with the names Server[1-16]. It creates them as expected, but then displays the sort order in a technically correct, but unrealistic way. aka Server1, Server10, Server11... Server16, Server2.

@bellwood
Copy link
Contributor

bellwood commented Jul 9, 2016

@jeremystretch this should have been ... sorted ... in #9 right?

@jeremystretch
Copy link
Member

That fix only applied to interfaces and interface templates. We could use an additional, more generic natural sort manager for this sort of thing. The same problem applies to device names, console ports, etc.

@jeremystretch jeremystretch added the type: feature Introduction of new functionality to the application label Jul 9, 2016
jeremystretch added a commit that referenced this issue Jul 12, 2016
possible fix for #243 generic sorting for device bays
@jeremystretch
Copy link
Member

Merged #248 which should address this. Need to pip install natsort or run upgrade.sh.

jeremystretch added a commit that referenced this issue Jul 12, 2016
@JNR8
Copy link

JNR8 commented Jul 14, 2016

After updating today I still see that all Device interfaces I've created are ordered incorrectly. Seems very Random. Device Type Template Interfaces are ordered OK, but any devices created from them get a random sort. Does this fix apply to devices you've already created?

@jeremystretch
Copy link
Member

The same ordering is used for both Interfaces and InterfaceTemplates. This issue is only for natsorted objects; we don't use natsort on interfaces because they're ordered by position rather than by name.

@JNR8
Copy link

JNR8 commented Jul 15, 2016

OK, so a different ordering for interfaces regardless of on the device or
in a template. But Interfaces on a device template are sorted in reverse
order and also in the order in which they were added. So for example if I
add "[1-48]" followed by "Management" virtual interface followed by
"[49-52]" then they appear in the imterface list in the order in which they
were added. But if I create a device from that template the order is
randomised (or so it seems), such as in the included screen shot.

[image: Inline images 1]

If you would prefer I could log this as a separate issue, so you can track
it easier. I appreciate I have kind of hijacked this issue thread.

Chris Jenner
Mob: 07739712218

On 14 July 2016 at 17:48, Jeremy Stretch notifications@github.com wrote:

The same ordering
https://github.com/digitalocean/netbox/blob/develop/netbox/dcim/models.py#L98
is used for both Interfaces and InterfaceTemplates. This issue is only for
natsorted objects; we don't use natsort on interfaces because they're
ordered by position rather than by name.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#243 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AEDGqXVmG4sDzHMATHGujhFmJ1oXpD59ks5qVmhTgaJpZM4JIdbW
.

if-fi pushed a commit to if-fi/netbox that referenced this issue Oct 1, 2016
possible fix for netbox-community#243 generic sorting for device bays
if-fi pushed a commit to if-fi/netbox that referenced this issue Oct 1, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

4 participants