Mailing List Archive

best practice storing config informations
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

--
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+unsubscribe@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.
Re: best practice storing config informations [ In reply to ]
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

Le sam. 21 janv. 2023 à 16:35, Markus Rosjat <markus.rosjat@gmail.com> a
écrit :

> 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
>
> --
> 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+unsubscribe@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
> <https://groups.google.com/d/msgid/trac-users/CAJ4osOmOxpJ8K2pk%2BXogSe26qwnpjOp8kw5nKL%2Bmpar82%2BC3Ww%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAG1%3DSYS0TGLTpVDkNLziVPauRBw8h9xLWCYmbEDbpJoO%2Bz_55Q%40mail.gmail.com.
Re: best practice storing config informations [ In reply to ]
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: image.png]
[image: 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

Am So., 22. Jan. 2023 um 17:20 Uhr schrieb Mickaël Bucas <mbucas@gmail.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
>
> Le sam. 21 janv. 2023 à 16:35, Markus Rosjat <markus.rosjat@gmail.com> a
> écrit :
>
>> 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
>>
>> --
>> 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+unsubscribe@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
>> <https://groups.google.com/d/msgid/trac-users/CAJ4osOmOxpJ8K2pk%2BXogSe26qwnpjOp8kw5nKL%2Bmpar82%2BC3Ww%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/trac-users/CAG1%3DSYS0TGLTpVDkNLziVPauRBw8h9xLWCYmbEDbpJoO%2Bz_55Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/trac-users/CAG1%3DSYS0TGLTpVDkNLziVPauRBw8h9xLWCYmbEDbpJoO%2Bz_55Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAJ4osO%3DE%3DAzjtE4VDGU6DAeAb_JnSUCXdq9x3LE3rA0vVpr9xg%40mail.gmail.com.