Ian wrote:
> brand new to trac and brand new to sqlite as well. I have python
> experience and postgres experiece though.
>
> I'm working on a small project where we want to have our own webpage
> which will submit and create a trac ticket.
>
> I think I see how to update the tables using pysqlite. But is there any
> sort of db diagram or map explaining all the tables and fields?
Since you already have some Python experience you could use the Trac
APIs to edit the tickets and attachments.
Look at trac/ticket/model.py and trac/attachment.py.
You can use it something like this:
from trac.env import Environment
from trac.ticket.model import Ticket
from trac.attachment import Attachment
env = Environment('/path/to/trac/env')
ticket = Ticket(env)
ticket.populate({'author': ..., }) # fill in the fields here
ticket_id = ticket.insert()
attachment = Attachment('ticket', ticket_id)
attachment.insert(filename, fileobj, filesize)
> Some of the fields on our form match up to fields in the ticket table,
> some do not. I assume for the fields that do not match up, i would use
> the ticket_custom table. ticket_custom.ticket would be the ticket # and
> name and value would be the name of the field and the value for that
> field. is that correct?
Yes.
> What about attachments? I see the attachments table but i'm not sure
> how it all works. What is the type and ipnr field for? and how do you
> associate the attachment with a ticket?
The type is 'ticket' or 'wiki' for whichever it's associated with.
"ipnr" is the IP number that submitted the attachment.
-- Matt Good
ah ok thanks, that pretty much explains it all. Actually, two last questions - how do you know which ticket an attachment is associated with? how is the file saved? meaning what path and filename does it get saved with.
thanks again
ian
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
