Changes between Version 4 and Version 5 of TeamRosterPlugin


Ignore:
Timestamp:
Oct 31, 2007 11:43:38 AM (7 years ago)
Author:
cbalan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TeamRosterPlugin

    v4 v5  
    2323You can check out TeamRosterPlugin from [http://trac-hacks.org/svn/teamrosterplugin here] using Subversion, or [source:teamrosterplugin browse the source] with Trac. 
    2424 
     25== Configuration == 
     26Enable the plugin in trac.ini: 
     27{{{ 
     28[components] 
     29tracteamroster.* = enabled 
     30}}} 
     31 
     32== API == 
     33 
     34{{{ 
     35#!python 
     36 
     37from tracteamroster.api import UserProfilesSystem, UserProfile 
     38 
     39# Get profile by id(username) 
     40user_profile = UserProfilesSystem(env).get_userProfile( 'cbalan' ) 
     41 
     42# Get active userProfiles 
     43team = UserProfilesSystem(env).get_active_userProfiles() 
     44 
     45# Search users ( Dummy example: All active developers that have an gmail account ) 
     46search_result_list = UserProfilesSystem.search_userProfile( UserProfile( role='developer', email='%gmail.com', enabled=1 ) ) 
     47 
     48# Add user Profile 
     49UserProfilesSystem.add_userProfile(UserProfile(id='jfoo', name='John Foo', email='jfoo@asd.org', role='developer')) 
     50 
     51# Update 
     52someUserProfile = UserProfilesSystem(env).get_userProfile('jfoo') 
     53someUserProfile.role = 'senior developer' 
     54someUserProfile.save() 
     55 
     56# Remove 
     57UserProfilesSystem(env).remove_userProfile(someUserProfile) 
     58 
     59}}} 
     60 
    2561== Example == 
    2662