Преглед на файлове

Fix paginate errors with CfgStates

Signed-off-by: Sven Velt <sven@velt.de>
Sven Velt преди 10 години
родител
ревизия
83001d9ee0
променени са 2 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 2 2
      states/templates/states/state_config_index.html
  2. 1 0
      states/views.py

+ 2 - 2
states/templates/states/state_config_index.html

@@ -32,7 +32,7 @@
 	<table border=1 width="100%">
 		<!-- Previous - Next -->
 		<tr><td colspan=4>
-			{% include "snippet_obj_prev_next.html" with objs=cfgstate objcount=cfgstatecount objname="State configs" %}
+			{% include "snippet_obj_prev_next.html" with objs=cfgstates objcount=cfgstatecount objname="State configs" %}
 		</td></tr>
 
 		<!-- Header line -->
@@ -48,7 +48,7 @@
 
 		<!-- Previous - Next -->
 		<tr><td colspan=4>
-			{% include "snippet_obj_prev_next.html" with objs=cfgstate objcount=cfgstatecount objname="State configs" %}
+			{% include "snippet_obj_prev_next.html" with objs=cfgstates objcount=cfgstatecount objname="State configs" %}
 		</td></tr>
 
 		</form>

+ 1 - 0
states/views.py

@@ -27,6 +27,7 @@ def state_index(Request):
 	print states
 
 	env['states'] = paginate(states, page, 30)
+	env['statecount'] = states.count()
 
 	ssf = StateSimpleFilter(Request.GET)
 	ssf.fields['hostname'].choices = [ (x, x) for x in State.objects.exclude(hostname='').values_list('hostname', flat=True).order_by('hostname').distinct() ]