best practice storing config informations

16 views
Skip to first unread message

Markus Rosjat

unread,
Jan 21, 2023, 10:35:44 AM1/21/23
to trac-...@googlegroups.com
hi list,

this is more a question for the developers i guess since i try to figure out where and how to store some values for my plugin. 

So the main stuff I simply store in trac.ini under a section but let's say I want to store stuff that is related but not really a "default" setting for the plugin? should i make a new section in the trac.ini or store it in a file within the plugin directory? I guess I could even create a new database table but I guess that's overkill for now?

Some advice here would be really helpful.

cheers 

Markus 

Mickaël Bucas

unread,
Jan 22, 2023, 11:20:14 AM1/22/23
to trac-...@googlegroups.com
Hi Markus

I use some plugins, like FullBlogPlugin and MasterTicketPlugin, and I've seen that they store configuration values in the "system" table of the Trac database.
It's a simple key-value table.
Maybe it's enough for your needs. 

Best regards

Mickaël Bucas

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAJ4osOmOxpJ8K2pk%2BXogSe26qwnpjOp8kw5nKL%2Bmpar82%2BC3Ww%40mail.gmail.com.

Markus Rosjat

unread,
Jan 23, 2023, 5:25:23 AM1/23/23
to trac-...@googlegroups.com
hello Mickael,

since i plan to make the whole thing a little more flexible i wouldn't want to pollute a system table of trac with my stuff. At the moment I am at a point where i could allow to creat as many webhooks as a user would need and provide as many payload templates as needed. That said only one template for each ticket action would be active of course.
Over the weekend I hammered out a basic user interface in the admin panels for all this but its not really ready for the github repo since i need to decide how to store the data first. I am no frontend guy so my stuff looks pretty ugly at the moment but it will do the job i guess. If someoen with more skills in jinja2 / js / css out there wants to take a shot at the design as soon as i push it to the repo feel free to do so and make a pull request. Here are some pics how it looks like at the moment

image.png
image.png

but back to the config for the webhooks and payloads, for now i would simply store it in the ini and that would be fine since it would be onyl one template for each type of payload but as mentioned it will be more flexable and then i dont want to pollute the ini further with it. So I guess i try to figure out how to update the database with a table for the payloads and the webhooks or try to store the payload stuff in a seperate file as well as the webhooks.

cheers

MArkus 

Reply all
Reply to author
Forward
0 new messages