Edgewall Software
Modify

Ticket #2206 (closed defect: invalid)

Opened 6 years ago

Last modified 6 years ago

Milestones.py uses row[STRING]= -- this breaks my installed postgres DBI

Reported by: anonymous Owned by: cmlenz
Priority: highest Milestone:
Component: roadmap Version: 0.8.4
Severity: blocker Keywords: patch included
Cc:
Release Notes:
API Changes:

Description

this works for me:
using psyco

/usr/lib/python2.3/site-packages/trac/Milestone.py +183

def get_tickets_for_milestone(env, db, milestone, fields=[ 'component' ]):
    stdfields = TicketSystem(env).get_ticket_fields()
    cursor = db.cursor()
    sql = "SELECT DISTINCT "
    for field in fields:
        if field not in [f['name'] for f in stdfields if not f.get('custom')]:
            sql += "%s.value AS %s, " % (field, field)
        else:
            sql += "ticket.%s AS %s, " % (field, field)
    sql += "ticket.id AS id, ticket.status AS status FROM ticket "
    for field in fields:
        if field not in [f['name'] for f in stdfields if not f.get('custom')]:
            sql += "LEFT OUTER JOIN ticket_custom %s ON (ticket.id=%s.ticket AND %s.name='%s') " % (field, field, field, field)
    sql += "WHERE milestone='%s' ORDER BY %s" % (sql_escape(milestone), field)

    cursor.execute(sql)

    tickets = []
    for row in cursor:
#    while 1:
#        row = cursor.fetchone()
#        if not row:
#            break
        c=0
        ticket = {}
        for field in fields:
            ticket[field] = row[c]
            c = c + 1
        ticket['id']=row[c]
        c = c + 1
        ticket['status']=row[c]
        c = c + 1

        tickets.append(ticket)
    return tickets

Attachments

Change History

comment:1 Changed 6 years ago by anonymous

  • Resolution set to invalid
  • Status changed from new to closed

You may want to check the trunk since this code has totally changed and postgresql is now supported. Reopen if this is still an issue.

comment:2 Changed 6 years ago by anonymous

  • Milestone 0.9 deleted
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from cmlenz. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.