| 1 | = Trac Data Models = |
| 2 | |
| 3 | The main models that developers might be interested in are Ticket and !WikiPage. The constructors each take the environment as the first parameter, and the ticket id or wiki page name next. |
| 4 | |
| 5 | == Ticket == |
| 6 | |
| 7 | Data Model - [source:/trunk/trac/ticket/model.py trac.ticket.model.Ticket] |
| 8 | {{{ |
| 9 | #!python |
| 10 | 29 class Ticket(object): |
| 11 | 30 |
| 12 | 31 def __init__(self, env, tkt_id=None, db=None): |
| 13 | }}} |
| 14 | |
| 15 | For usage examples, see [source:/trunk/trac/ticket/web_ui.py trac.ticket.web_ui]. |
| 16 | |
| 17 | == !WikiPage == |
| 18 | |
| 19 | Data Model - [source:/trunk/trac/wiki/model.py trac.wiki.model.WikiPage] |
| 20 | {{{ |
| 21 | #!python |
| 22 | 26 class WikiPage(object): |
| 23 | 27 """Represents a wiki page (new or existing).""" |
| 24 | 28 |
| 25 | 29 def __init__(self, env, name=None, version=None, db=None): |
| 26 | }}} |
| 27 | |
| 28 | The !WikiPage has an optional parameter for the version, and you probably won't need to bother with the last parameter which is an optional db connection. |
| 29 | |
| 30 | For usage examples, see [source:/trunk/trac/wiki/web_ui.py trac.wiki.web_ui]. |