~schooltool-owners/schooltool/schooltool.cando_socialskills

« back to all changes in this revision

Viewing changes to src/schooltool/cando/browser/course.py

  • Committer: Douglas Cerna
  • Date: 2012-08-27 19:25:12 UTC
  • Revision ID: douglascerna@yahoo.com-20120827192512-mxmcei6ioafunnl1
Made Batch Assign Skills view to associate several nodes at once

Show diffs side-by-side

added added

removed removed

Lines of Context:
776
776
                        })
777
777
                continue
778
778
            if course_attr_value:
779
 
                assignment = {}
 
779
                assigned = False
780
780
                for node in nodes:
781
781
                    node_attr_value = getattr(node, node_attr, '')
782
782
                    if node_attr_value:
783
783
                        if node_attr_value == course_attr_value:
784
 
                            assignment = {
 
784
                            assignments.append({
785
785
                                    'course': course,
786
786
                                    'course_attr': course_attr_value,
787
787
                                    'node': node,
788
788
                                    'node_attr': node_attr_value,
789
 
                                    }
790
 
                if assignment:
791
 
                    assignments.append(assignment)
792
 
                else:
 
789
                                    })
 
790
                            assigned = True
 
791
                if not assigned:
793
792
                    not_assigned.append({
794
793
                            'course': course,
795
794
                            'course_attr': course_attr_value,