Template list upgrade and show deleted vms
Closes #234 (closed) Closes #258 (closed)
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
172 173 return super(FilterMixin, 173 174 self).get_queryset().filter(**self.get_queryset_filters()) 174 175 176 def create_fake_get(self): 177 """ 178 Updates the request's GET dict to filter the vm list 179 For example: "name:xy node:1" updates the GET dict 180 to resemble this URL ?name=xy&node=1 181 182 "name:xy node:1".split(":") becomes ["name", "xy node", "1"] 183 we pop the the first element and use it as the first dict key 184 then we iterate over the rest of the list and split by the last 185 whitespace, the first part of this list will be the previous key's 186 value, then last part of the list will be the next key. 187 The final dict looks like this: {'name': xy, 'node':1} -
Owner
make this a doctest
-
-
Owner
+1
-
190 190 The final dict looks like this: {'name': xy, 'node':1} 191 191 192 192 >>> f = FilterMixin() 193 >>> f._parse_get({'s': "hello"}) # doctest: +ELLIPSIS 194 {u's': u'...', u'name': u'hello'} 195 >>> f._parse_get({'s': "name:hello owner:test"}) # doctest: +ELLIPSIS 196 {u'owner': u'test', u's': u'...', u'name': u'hello'} 197 >>> f._parse_get({'s': "name:hello whitespace node:node 3 oh"}) 198 ... # doctest: +ELLIPSIS 199 {u'node': u'node 3 oh', u's': u'...', u'name': u'hello whitespace'} 193 >>> o = f._parse_get({'s': "hello"}).items() 194 >>> o.sort() 195 >>> o # doctest: +ELLIPSIS -
Owner
sorted(o)
? ;)
-
-
-