On Fri, Oct 3, 2008 at 12:56 PM, sfx <[EMAIL PROTECTED]> wrote:
>
> Hi, I tried this method, and does work ( a bit).
> Now I can not figure out why I can not insert values into
> ticket_custom table.
> Values go fine into ticket table and do appear fine in browser but
> nothing gets inserted into ticket_custom. I do not get any error or
> any warning when I insert into ticket_custom, but the data gets lost,
> and nothing appears.
> any idea whats going on ?
> Regards

Can't say without seeing your code.  You insert stuff into
ticket_custom the same way you would insert into any other table.  Are
you sure nothing's going into the database?  Are you committing the db
changes?

Really though, you shouldn't have to directly access the DB to do this
at all.  Instead, take the fields parsed out of your bugtracker and
create ticket objects.  Like so:

from trac.env import open_environment
from trac.ticket.model import Ticket

env = open_environment('/path/to/trac/env')
db = env.get_db_cnx()
for old_ticket in old_tickets:
    ticket = Ticket(env)
    for field, value in old_ticket.iteritems():
        ticket[field] = value
    ticket.insert(db)
db.commit()

This assumes that your old bugtracker tickets are in a list of
dictionaries called old_tickets where each item is a dictionary of
field/value pairs.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to