43 | | ^(Implementation results should be described and linked here (from the wiki or the repository)^ |
| 43 | These functions ware added into the [source:/manage/sched/sophie2-wbs.py] file: |
| 44 | {{{ |
| 45 | def outImportancedEffort(): |
| 46 | for t in Task.all.values() : |
| 47 | if isinstance(t,Rev) : |
| 48 | print "sqlite3 /sophie-project/sophie2/db/trac.db \"INSERT INTO ticket_custom ( ticket,name,value ) SELECT id AS ticket, \'importance\' AS name, %s AS value FROM ticket where ticket.summary = \'%s\' AND id NOT IN (SELECT ticket FROM ticket_custom WHERE name = \'importance\');\""% (t.importance(), t.name) |
| 49 | print "sqlite3 /sophie-project/sophie2/db/trac.db \"INSERT INTO ticket_custom ( ticket,name,value ) SELECT id AS ticket, \'effort\' AS name, %s AS value FROM ticket where ticket.summary = \'%s\' AND id NOT IN (SELECT ticket FROM ticket_custom WHERE name = \'effort\');\""% (t.effort, t.name) |
| 50 | }}} |
| 51 | |
| 52 | Overview: |
| 53 | The function takes no arguments and generates SQL queries that insert data in the ticket_custom table. This is where the custom fields "importance" and "effort" are stored. |
| 54 | |
| 55 | Usage: |
| 56 | * Go to the sophie2-wbs.py file folder |
| 57 | * In the sophie2-wbs.py uncommnet the outImportancedEffort() call |
| 58 | * Execute: |
| 59 | {{{ |
| 60 | python sophie2-wbs.py | bash |
| 61 | }}} |
| 62 | |
| 63 | |
| 64 | {{{ |
| 65 | def outUpdateCustom(field): # field - "effort" or "importance" for now. |
| 66 | for t in Task.all.values() : |
| 67 | if isinstance(t,Rev) : |
| 68 | if(field == "effort"): |
| 69 | value = t.effort |
| 70 | if(field == "importance"): |
| 71 | value = t.importance() |
| 72 | print "sqlite3 /sophie-project/sophie2/db/trac.db \"UPDATE ticket_custom SET value = \'%s\' WHERE name = \'%s\' and ticket = (SELECT id FROM ticket WHERE summary = \'%s\')\""% (value, field, t.name) |
| 73 | }}} |
| 74 | |
| 75 | Overview: |
| 76 | This function takes one argument: "importance" or "effort". It generates SQL queries that update the information in ticket_custom table according to the [source:/manage/sched/sophie2-wbs.py]. |
| 77 | Usage: |
| 78 | * Go to the sophie2-wbs.py file folder |
| 79 | * In the sophie2-wbs.py uncommnet the outUpdateCustom(sys.argv[1]) call |
| 80 | * Execute: |
| 81 | {{{ |
| 82 | python sophie2-wbs.py effort | bash |
| 83 | //this will update the effort field |
| 84 | python sophie2-wbs.py importance | bash |
| 85 | //this will update the importance field |
| 86 | }}} |
| 87 | |