- Timestamp:
- 01/27/11 13:48:52 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sara_cmt/sara_cmt/cluster/templatetags/ramonb_extras.py
r12438 r12439 171 171 172 172 """ 173 Something weird 173 Get list of racks in a cluter 174 175 Usage: {% getracks <cluster> as <listname> %} 174 176 """ 175 177 … … 181 183 182 184 def render(self, context): 183 attr='cluster__name'184 val =self.cluster185 186 rack_names = [ ]187 185 188 186 cluster_units = get_model('cluster', 'HardwareUnit').objects.filter( cluster__name=str(self.cluster) ) 189 187 190 188 for u in cluster_units: 191 if u.rack.label not in rack_names: 192 rack_names.append( u.rack.label ) 189 if u.rack not in self.racks: 193 190 self.racks.append( u.rack ) 194 191
Note: See TracChangeset
for help on using the changeset viewer.