wiki:CustomFieldAdminPlugin

Administer Custom Fields in Trac

Notice: Equivalent functionality is proposed for Trac in #11469.

Description

This plugin is a Web Admin panel for administering custom fields - adding, modifying and deleting them without editing the trac.ini file directly.

This plugin is a cooperation between CodeResort.com and Optaros.com, and is made freely available under a BSD license.

Bugs/Feature Requests

Existing bugs and feature requests for CustomFieldAdminPlugin are here.

If you have any issues, create a new ticket.

defect

38 / 38

enhancement

20 / 20

task

1 / 1

Download

Download the zipped source from here.

Source

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

Installation

The plugin can also be installed directly from the code repository:

pip install svn+https://trac-hacks.org/svn/customfieldadminplugin/1.2

Substitute 1.2 with 0.11 for older Trac version.

Configuration

Enable the plugin in your trac.ini file:

[components]
customfieldadmin.* = enabled

API

The plugin also has an API that can be called from other code if you need to create or modify custom fields. Here is an interactive session as example:

from trac.env import Environment
from customfieldadmin.api import CustomFields

myenv = Environment('/path/to/env')
mycfcomp = CustomFields(myenv)

# Get Cusom fields (list of dicts)
myfields = mycfcomp.get_custom_fields()
for item in myfields: print item

# Create a custom field - text box
mycfdict = {                # a template dictionary
    'name': 'test01',       # name of field (alphanumeric only)
    'type': 'text',         # text|checkbox|select|radio|textarea
    'label': 'Test 01',     # description
    'value': 'first test',  # default value for field content
    'options': None,        # options for select and radio types (list, leave first empty for optional)
    'rows': None,           # number of rows for text area
    'order': 0 }            # specify sort order for field, 0 for last
mycfcomp.update_custom_field(mycfdict, create=True)

# Updating
mycfdict['type'] = 'select'
mycfdict['options'] = ['', 'one', 'two', 'three']
mycfdict['value'] = None
mycfcomp.update_custom_field(mycfdict)

# And deleting an existing custom field
mycfcomp.delete_custom_field(mycfdict)

Recent Changes

17788 by rjollos on 2020-07-03 00:10:15
TracCustomFieldAdmin 0.3.0dev: Fix indentation and line endings
17787 by rjollos on 2020-07-03 00:09:17
TracCustomFieldAdmin 0.3.0dev: Support time custom fields

Add reference and list formats for text type.

JavaScript is required.

Refs #7015.

17786 by rjollos on 2020-07-02 22:22:38
TracCustomFieldAdmin 0.3.0dev: Fix failing test cases with Trac 1.2
(more)

Author/Contributors

Authors: osimons, cbalan
Maintainer: osimons
Contributors:

Last modified 8 weeks ago Last modified on May 22, 2020, 8:10:26 PM