wiki:CustomFieldProviderPlugin

Version 2 (modified by k0s, 6 years ago) (diff)

--

provide custom fields programmatically

Description

The CustomFieldProviderPlugin provides an extension point that is used to populate custom fields programmatically. Plugins may implement the ICustomFieldProvider interface and have their custom ticket fields registered.

Bugs/Feature Requests

Existing bugs and feature requests for CustomFieldProviderPlugin are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

You can check out CustomFieldProviderPlugin from here using Subversion, or browse the source with Trac.

Example

See the SampleCustomFieldProvider in for an example. Documentation on how to use the interface is in [source:customfieldproviderplugin/0.11/customfieldprovider/interface.py interface.py:

"""
interface to programatically provide custom ticket fields
"""
from trac.core import Interface
class ICustomFieldProvider(Interface):
    def fields():
        """
        should return a dictionary of dictionaries describing the custom
        fields.  The primary key should be the field name.  The secondary keys
        should be the options and the secondary values should be field values
        Example:
        { 'mycustomfield': { 'type': 'radio',
                             'label': 'My Custom Field',
                             'options': ['foo', 'bar', 'baz']} }
        'type' == 'text' is assumed if not provided
        See http://trac.edgewall.org/wiki/TracTicketsCustomFields
        for defined semantics
        """

Recent Changes

[5526] by k0s on 2009-04-16 18:55:59
add license information
[5525] by k0s on 2009-04-16 18:55:10
add a link to its new home
[5524] by k0s on 2009-04-16 16:42:31
  • expose the Interface
  • give a version

Author/Contributors

Originally developed at The Open Planning Project

Author: k0s
Contributors: