Guest User

Untitled

a guest
Jun 24th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1.  
  2. for plan in plans:
  3. feature_name = "feature name"
  4. data = features.get(feature_name)
  5. if data is None:
  6. features[feature_name] = [ plan.feature_object_data ]
  7. else:
  8. features[feature_name].append(plan.feature_object_data)
  9. pass
  10.  
  11. ''' dictionary of feature names
  12. '''
  13. features = {
  14. "feature name" : [ # a list, *.append(...)
  15. # append the corresponding plan feature data
  16. # - it can be the feature code or the feature object
  17. ],
  18. ...
  19. }
  20.  
  21. <!--- HTML -->
  22.  
  23.  
  24.  
  25. <tal:loop repeat="planids plan_ids">
  26. <!-- column header -->
  27.  
  28. <tal:x tal:define="idx repeat/plan_ids/index;
  29. values features/values;
  30. values python:(values.reverse(), values)[1]">
  31.  
  32. <div style="float:left"
  33. class="plan-column"
  34. tal:repeat="feature_object python:values[idx]">
  35.  
  36. <div tal:content="feature_object/name">feature name</div>
  37.  
  38. </div>
  39. </tal:x>
  40.  
  41. </tal:loop>
Add Comment
Please, Sign In to add comment