Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Trac: Users

Query options of a custom field

 

 

Trac users RSS feed   Index | Next | Previous | View Threaded


ryano at physiosonics

Jun 29, 2009, 5:51 PM

Post #1 of 5 (204 views)
Permalink
Query options of a custom field

Hi,

I would like to list the options of a custom field in a wiki page.
Using the WikiTable macro [1] I've been able to do this for fields of
a ticket that have their own table or exist in a table of the
database, such as component and resolution.

SELECT name, description FROM component ORDER BY name

SELECT name FROM enum WHERE type = 'resolution'

However, I don't understand from looking at the database schema [2] if/
where the options of a custom field or stored, though I think that I
understand that the actual value of a custom field is stored in the
database rather than a key.

[1] http://trac-hacks.org/wiki/WikiTableMacro
[2] http://trac.edgewall.org/wiki/TracDev/DatabaseSchema

Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users[at]googlegroups.com
To unsubscribe from this group, send email to trac-users+unsubscribe[at]googlegroups.com
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


DWinslow at aiminstitute

Jun 30, 2009, 5:00 AM

Post #2 of 5 (183 views)
Permalink
Re: Query options of a custom field [In reply to]

The custom values are stored in the ticket_custom table. The columns are
ticket, name, and value. Ticket holds the ticket id, name holds the
field name, and value holds the field value. It's quite a cumbersome way
to do things but it works.

-----Original Message-----
From: trac-users[at]googlegroups.com [mailto:trac-users[at]googlegroups.com]
On Behalf Of RJOllos
Sent: Monday, June 29, 2009 7:51 PM
To: Trac Users
Subject: [Trac] Query options of a custom field


Hi,

I would like to list the options of a custom field in a wiki page.
Using the WikiTable macro [1] I've been able to do this for fields of
a ticket that have their own table or exist in a table of the
database, such as component and resolution.

SELECT name, description FROM component ORDER BY name

SELECT name FROM enum WHERE type = 'resolution'

However, I don't understand from looking at the database schema [2] if/
where the options of a custom field or stored, though I think that I
understand that the actual value of a custom field is stored in the
database rather than a key.

[1] http://trac-hacks.org/wiki/WikiTableMacro
[2] http://trac.edgewall.org/wiki/TracDev/DatabaseSchema

Thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users[at]googlegroups.com
To unsubscribe from this group, send email to trac-users+unsubscribe[at]googlegroups.com
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


ryano at physiosonics

Jul 1, 2009, 11:21 AM

Post #3 of 5 (174 views)
Permalink
Re: Query options of a custom field [In reply to]

It sounds to me like the values for custom fields of a ticket are
stored in the ticket_custom table, but not the available options for a
custom field. Where are the possible values for the custom field
stored?

On Jun 30, 5:00 am, "Dan Winslow" <DWins...@aiminstitute.org> wrote:
> The custom values are stored in the ticket_custom table. The columns are
> ticket, name, and value. Ticket holds the ticket id, name holds the
> field name, and value holds the field value. It's quite a cumbersome way
> to do things but it works.
>
> -----Original Message-----
> From: trac-users[at]googlegroups.com [mailto:trac-users[at]googlegroups.com]
>
> On Behalf Of RJOllos
> Sent: Monday, June 29, 2009 7:51 PM
> To: Trac Users
> Subject: [Trac] Query options of a custom field
>
> Hi,
>
> I would like to list the options of a custom field in a wiki page.
> Using the WikiTable macro [1] I've been able to do this for fields of
> a ticket that have their own table or exist in a table of the
> database, such as component and resolution.
>
> SELECT name, description FROM component ORDER BY name
>
> SELECT name FROM enum WHERE type = 'resolution'
>
> However, I don't understand from looking at the database schema [2] if/
> where the options of a custom field or stored, though I think that I
> understand that the actual value of a custom field is stored in the
> database rather than a key.
>
> [1]http://trac-hacks.org/wiki/WikiTableMacro
> [2]http://trac.edgewall.org/wiki/TracDev/DatabaseSchema
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users[at]googlegroups.com
To unsubscribe from this group, send email to trac-users+unsubscribe[at]googlegroups.com
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


yoheeb at gmail

Jul 1, 2009, 12:13 PM

Post #4 of 5 (175 views)
Permalink
Re: Query options of a custom field [In reply to]

On Jul 1, 1:21 pm, RJOllos <ry...@physiosonics.com> wrote:
> It sounds to me like the values for custom fields of a ticket are
> stored in the ticket_custom table, but not the available options for a
> custom field.  Where are the possible values for the custom field
> stored?
>
> On Jun 30, 5:00 am, "Dan Winslow" <DWins...@aiminstitute.org> wrote:
>
> > The custom values are stored in the ticket_custom table. The columns are
> > ticket, name, and value. Ticket holds the ticket id, name holds the
> > field name, and value holds the field value. It's quite a cumbersome way
> > to do things but it works.
>
> > -----Original Message-----
> > From: trac-users[at]googlegroups.com [mailto:trac-users[at]googlegroups.com]
>
> > On Behalf Of RJOllos
> > Sent: Monday, June 29, 2009 7:51 PM
> > To: Trac Users
> > Subject: [Trac] Query options of a custom field
>
> > Hi,
>
> > I would like to list the options of a custom field in a wiki page.
> > Using the WikiTable macro [1] I've been able to do this for fields of
> > a ticket that have their own table or exist in a table of the
> > database, such as component and resolution.
>
> > SELECT name, description FROM component ORDER BY name
>
> > SELECT name FROM enum WHERE type = 'resolution'
>
> > However, I don't understand from looking at the database schema [2] if/
> > where the options of a custom field or stored, though I think that I
> > understand that the actual value of a custom field is stored in the
> > database rather than a key.
>
> > [1]http://trac-hacks.org/wiki/WikiTableMacro
> > [2]http://trac.edgewall.org/wiki/TracDev/DatabaseSchema
>
> > Thanks!

the possible options of custom fields (I am assuming a select type
here) are stored in the .ini file. my guess is the only "off the
shelf" option you'll find, and I have never used this, so I can't
verify is the http://trac-hacks.org/wiki/IniGetMacro

in theory, something like this [[IniGet(CustomFieldA.options)]]

probably in a table or something:
||'''Custom Field Name'''||'''Possible Values'''||
||CustomFieldA|| [[IniGet(CustomFieldA.options)]] ||
||CustomFieldX|| [[IniGet(CustomFieldX.options)]] ||

I also expect it will be ugly with a response like 100|200|300|400|
500 so you might want to augment this macro to split on the | and
format the result string. Again, assuming it works.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users[at]googlegroups.com
To unsubscribe from this group, send email to trac-users+unsubscribe[at]googlegroups.com
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


DWinslow at aiminstitute

Jul 1, 2009, 12:44 PM

Post #5 of 5 (174 views)
Permalink
Re: Query options of a custom field [In reply to]

Right, they are in the trac.ini file.

-----Original Message-----
From: trac-users[at]googlegroups.com [mailto:trac-users[at]googlegroups.com] On Behalf Of yoheeb
Sent: Wednesday, July 01, 2009 2:13 PM
To: Trac Users
Subject: [Trac] Re: Query options of a custom field


On Jul 1, 1:21 pm, RJOllos <ry...@physiosonics.com> wrote:
> It sounds to me like the values for custom fields of a ticket are
> stored in the ticket_custom table, but not the available options for a
> custom field.  Where are the possible values for the custom field
> stored?
>
> On Jun 30, 5:00 am, "Dan Winslow" <DWins...@aiminstitute.org> wrote:
>
> > The custom values are stored in the ticket_custom table. The columns are
> > ticket, name, and value. Ticket holds the ticket id, name holds the
> > field name, and value holds the field value. It's quite a cumbersome way
> > to do things but it works.
>
> > -----Original Message-----
> > From: trac-users[at]googlegroups.com [mailto:trac-users[at]googlegroups.com]
>
> > On Behalf Of RJOllos
> > Sent: Monday, June 29, 2009 7:51 PM
> > To: Trac Users
> > Subject: [Trac] Query options of a custom field
>
> > Hi,
>
> > I would like to list the options of a custom field in a wiki page.
> > Using the WikiTable macro [1] I've been able to do this for fields of
> > a ticket that have their own table or exist in a table of the
> > database, such as component and resolution.
>
> > SELECT name, description FROM component ORDER BY name
>
> > SELECT name FROM enum WHERE type = 'resolution'
>
> > However, I don't understand from looking at the database schema [2] if/
> > where the options of a custom field or stored, though I think that I
> > understand that the actual value of a custom field is stored in the
> > database rather than a key.
>
> > [1]http://trac-hacks.org/wiki/WikiTableMacro
> > [2]http://trac.edgewall.org/wiki/TracDev/DatabaseSchema
>
> > Thanks!

the possible options of custom fields (I am assuming a select type
here) are stored in the .ini file. my guess is the only "off the
shelf" option you'll find, and I have never used this, so I can't
verify is the http://trac-hacks.org/wiki/IniGetMacro

in theory, something like this [[IniGet(CustomFieldA.options)]]

probably in a table or something:
||'''Custom Field Name'''||'''Possible Values'''||
||CustomFieldA|| [[IniGet(CustomFieldA.options)]] ||
||CustomFieldX|| [[IniGet(CustomFieldX.options)]] ||

I also expect it will be ugly with a response like 100|200|300|400|
500 so you might want to augment this macro to split on the | and
format the result string. Again, assuming it works.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users[at]googlegroups.com
To unsubscribe from this group, send email to trac-users+unsubscribe[at]googlegroups.com
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Trac users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.