Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

CIRCLE / cloud

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 94
  • Merge Requests 10
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Merged
Merge request !73 opened Apr 29, 2014 by Kálmán Viktor@kviktor 
  • Report abuse
Report abuse

Feature Table Sorting

Sort vm list, template list and lease list.

vm list and template list are sorted with js if it's enabled

  • Discussion 4
  • Commits 13
  • Changes
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Őry Máté
    @orymate started a discussion on the diff Apr 30, 2014
    circle/dashboard/static/dashboard/js/stupidtable.min.js
    1 // Stupid jQuery table plugin.
    • Őry Máté @orymate commented Apr 30, 2014
      Owner

      add attribution

      add attribution
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Apr 30, 2014
    circle/dashboard/views.py
    989 990 s = self.request.GET.get("s")
    990 991 if s:
    991 992 queryset = queryset.filter(name__icontains=s)
    993
    994 sort = self.request.GET.get("sort")
    995 # remove "-" that means descending order
    996 # also check if the column name is valid
    997 if (sort and
    998 sort.replace("-", "")
    • Őry Máté @orymate commented Apr 30, 2014
      Owner

      sort.lstrip("-")?

      `sort.lstrip("-")`?
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Apr 30, 2014
    circle/dashboard/views.py
    989 990 s = self.request.GET.get("s")
    990 991 if s:
    991 992 queryset = queryset.filter(name__icontains=s)
    993
    994 sort = self.request.GET.get("sort")
    995 # remove "-" that means descending order
    996 # also check if the column name is valid
    997 if (sort and
    998 sort.replace("-", "")
    999 in [i.name for i in Instance._meta.fields] + ["pk"]):
    1000 queryset = queryset.order_by(
    1001 # we order nodes by the normalized_name
    1002 sort.replace("node", "node__normalized_name"))
    • Őry Máté @orymate commented Apr 30, 2014
      Owner

      Node.Meta.ordering is used implicitly.

      Node.Meta.ordering is used implicitly.
    Please register or sign in to reply
  • Őry Máté @orymate commented Apr 30, 2014
    Owner

    +1

    +1
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Őry Máté
Assignee
Őry Máté @orymate
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View labels
2
2 participants
Reference: circle/cloud!73