Edgewall Software

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#2206 closed defect (invalid)

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

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


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)
            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)


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

    return tickets

Attachments (0)

Change History (2)

comment:1 by anonymous, 15 years ago

Resolution: invalid
Status: newclosed

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 by anonymous, 15 years ago

Milestone: 0.9

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.