Adding new columns to trac AccountManager plugin
I want to add new columns to the trac AccountManager
plugin, I already edited the admin_user.html, but in python what do I have to edit, which files. I want to add two more data field. ex: group and telephone, How can I do that?
UPDATED
This is the two field I added in the admin_user.html
<div class="field">
<label>Telephone:<br />
<input type="text" name="tel" class="textwidget"
value="${account.tel}" /></label>
</di开发者_C百科v>
<div class="field">
<label>Group:<br />
<input type="text" name="group" class="textwidget"
value="${account.group}" /></label>
</div>
and I also added the two column to the table:
<td>${acct.group}</td>
<td>${acct.last_visit}</td>
But I'm not familiar with python, so I don't know how can I add the functionality in the python code
Did you check UserManagerPlugin for it's ability to add arbitrary new columns?
But maybe you want it some additions to the generic view in users admin page, right? These must be optional, if you care for universal use, of course.
In 'admin.py' you'll see a Class 'AccountManagerAdminPages' with a module '_do_users'. This module is primary handler for all requests related to the admin page in question. While the beginning is about processing 'POST' (user input) everything after the line 'if listing_enabled:' will prepare the page displayed next. You'll see various sources, but main source is query to Trac db table 'session_attribute'.
Again I'd like you to take a look at UserManagerPlugin - all what you may want and more.
Disclosure: I'm the current maintainer of AccountManagerPlugin.
精彩评论