Opened 16 years ago
Closed 16 years ago
#3520 closed enhancement (fixed)
get the names from the database
Reported by: | anonymous | Owned by: | Vladislav Naumov |
---|---|---|---|
Priority: | normal | Component: | CcSelectorPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.10 |
Description
hello! i'm a newbie in using trac.. i just want to know on how to connect the db using sqlite in the jscript file.. hope to hear an answer from you soon.. tnx in advance!
Attachments (0)
Change History (5)
comment:1 follow-up: 2 Changed 16 years ago by
comment:2 Changed 16 years ago by
Replying to vnaum:
Sorry, I do not understand what are you trying to do. You surely cannot connect to SQLite database (on server) from Javascript in your browser.
If you want to edit pre-defined set of email addresses in CcSelectorPlugin - just edit cc_selector.js before installing plugin. If you already installed it - edit it now and re-install plugin again.
Hi! How would I get the names of the users by means of connecting to the database? And not manually adding the names or email address of the users in the jscript file.. Hope to hear a reply from you.. tnx!
comment:3 Changed 16 years ago by
Keywords: | sqlite ccselector removed |
---|---|
Priority: | high → normal |
Status: | new → assigned |
Summary: | how to connect trac.db to jscript file → get the names from the database |
Type: | defect → enhancement |
I will do this eventually, but I can't promise anything: after all, I'm doing this in my spare time.
If you want your list right away - consider editing js file manually.
If you need different lists for different environments - you can compile different lists into different *.egg files (setup bdist_egg
) and eggs into plugin subdirs.
comment:4 follow-up: 5 Changed 16 years ago by
Couldn't we treat the javascript file as a Genshi template and get the user list as follows?
vars = { users: PermissionSystem(self.env).get_users_with_permission('TICKET_VIEW') }
comment:5 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Replying to anonymous:
Couldn't we treat the javascript file as a Genshi template
It's not that simple. According to Genshi Tutorial,
The template will be parsed by Genshi using an XML parser, which means that it needs to be well-formed XML.
And I don't know if it is possible to turn JS source into well-formed XML (it's probably possible, but I have no idea how to do this). Instead I used template to put developer list into page source and fetched data from there. And there are two different template engines in Trac to support (Clearsilver in 0.10 and Genshi in 0.11).
Also, to provide templates plugin should implement ITemplateProvider and to process requests is also should be IRequestHandler - so it does all this now.
Sorry, I do not understand what are you trying to do. You surely cannot connect to SQLite database (on server) from Javascript in your browser.
If you want to edit pre-defined set of email addresses in CcSelectorPlugin - just edit cc_selector.js before installing plugin. If you already installed it - edit it now and re-install plugin again.