Version 8 (modified by Roberto Longobardi, 8 years ago) (diff)


Resource Reservation plugin for Trac


A Trac plugin and macro to allow for visually planning and reserving the use of resources in your environment, e.g. test machines, consumable test data, etc..., with just one click.

Take a look at the screenshot to have an idea:

Installation of the plugin adds a new tab named Resource Reservation that leads to a pre-filled Wiki page with the macro already in place.

By default, the macro displays an empty calendar spanning three months in the future, including the current month. You can then:

  • Add a new resource, by entering the resource name in the edit box and click Add a Resource
  • See who owns a resource in any particular date:
    • A white cell indicates the resource is free at a certain date
    • A blue cell indicates the resource is reserved by the current user at a certain date
    • A red cell indicates some other user has reserved the resource at a certain date. The name of the user can be seen by hovering with the mouse on the cell.
  • Reserve the resource for any days in the calendar, by simply clicking on the corresponding table cell => the information is saved in the database on the fly, no need to save the page. The cell will become blue
  • Cancel a resource reservation, when it is reserved by you (blue cell), by simply clicking on it again => The cell becomes white again
  • Take on a resource reserved by something else (red cell), by simply clicking on the corresponding cell => The cell becomes blue and the resource is immediately assigned to the current user

You can edit the default page, changing the macro default parameters:

  • type: you can define any number of resource types by simply providing a different value for this parameter to any instance of the macro. This way, you can plan the use of different types of resources at the same time, with no conflict between them
  • period: the number of months, including the current one, to display in the calendar
  • title: the title, i.e. descriptive name of the resource type, to be used in the calendar as the header of the resource names column

Or you can add the following snippet in any of your Wiki pages, for example to keep track of multiple resource types in different places:


Project site:

Bugs/Feature Requests

If you have any issues, create a new ticket.

Existing bugs and feature requests for ResourceReservationPlugin are here.

Ticket Summary Status Severity Priority Type Owner Created Description
#7478 Provide an hourly view new normal normal enhancement Roberto Longobardi 8 years ago

For quite some time I've been wanting to add a conference room reservation calendar to my Trac instance. There hasn't been any plugin to provide this, but now this looks to be the closest thing yet!

For a room reservation, we'd need the ability to reserve in a minimum of 30 min increments. So, it appears that day and weekly views would need to be added that provide a more fine grained reservation ability.

Just thought I'd post this as a potential enhancement and see what everyone thinks.

#7480 Does not work on IE closed normal normal defect Roberto Longobardi 8 years ago

Does not work on Internet Explorer, due to a bug ion how I get the target from the mouse event.

#8464 Project environment upgrade fails with database error reopened normal normal defect Roberto Longobardi 8 years ago

I was trying to install the ResourceReservationPlugin on my system running:

Trac: 0.12.2dev-r10313
MySQL: "5.0.75-0ubuntu10.5", client: "5.0.75", thread-safe: 1

Installation goes fine, I managed to enable the plugin, but failed to upgrade the Trac environment:

Trac [/export/trac/my_project]> upgrade
use the hashlib module instead
resreservation needs to create the db
resreservation needs to create the db
resreservation needs to create the db
exception in the database creation
OperationalError: (1072, "Key column 'res_from' doesn't exist in table")
Trac [/export/trac/my_project]> quit

I checked the database but there were no tables by the name res* .

#8627 Missing Component closed normal normal defect Roberto Longobardi 8 years ago

Resource doesn't load.. tried installing WikiCalendar .. but that fails too missing locale information.

2011-03-21 11:24:05,068 Trac[loader] DEBUG: Loading resreservation from /usr/lib/python2.4/site-packages/ResourceReservation-1.0.1-py2.4.egg 2011-03-21 11:24:05,071 Trac[loader] ERROR: Skipping "resreservation = resreservation": (can't import "ImportError: cannot import name Calendar")

#8746 Unicode trouble closed normal normal defect Roberto Longobardi 8 years ago

First off, nice work, I was looking for this for quite some time!

I did get:

Error: Macro !ResourceReservationList(type=resource,period=3,title=Prüfstand) failed
'unicode' object has no attribute 'month'

Adding some resources and setting reservations works - but only up until reloading the page. Then above failure blocks the macro. Flushing the resreservation table did help. It seems as soon as I enter reservation dates it stops to work. There are unicode characters in german named months if that creates an issue.

Trac-Version: 0.11.7

hum, I just found some output on the console:

Trac[formatter] ERROR: Macro !ResourceReservationList(type=resource,period=3,title=Prüfstand) failed: 
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/trac/wiki/", line 484, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "/usr/lib/python2.6/dist-packages/trac/wiki/", line 180, in process
    text = self.processor(text)
  File "/usr/lib/python2.6/dist-packages/trac/wiki/", line 167, in _macro_processor
  File "/usr/local/lib/python2.6/dist-packages/ResourceReservation-1.0.3-py2.6.egg/resreservation/", line 52, in expand_macro
    return _render_resreservation_list(self.env, req, res_type, period, title, override)
  File "/usr/local/lib/python2.6/dist-packages/ResourceReservation-1.0.3-py2.6.egg/resreservation/", line 130, in _render_resreservation_list
    curr_month = curr_date.month - first_month
!AttributeError: 'unicode' object has no attribute 'month'
#9621 Edit a resource name new major high enhancement Roberto Longobardi 7 years ago

It would be useful to add more management capabilities to the plugin. For example, renaming or deleting a specific resource in the list.

#10046 Using views with different time periods will fail new normal normal defect Roberto Longobardi 7 years ago

Editing some items for example in month 4, 5 or 6 using the macro

[[ResourceReservationList(type=testmachine,period=6,title=Test Machine,override=false)]]

and then using another view on the same or a different wiki site, p.e.

[[ResourceReservationList(type=testmachine,period=3,title=Test Machine,override=false)]]

will lead to the following error

Error: Macro ResourceReservationList(type=testmachine,period=3,title=Test Machine) failed
list index out of range
#10048 Submit using two macros on one wiki page new normal normal defect Roberto Longobardi 7 years ago

When on a wiki page more than one macro with different types is used, p.e.:

=== room1 ===

=== room2 ===

there will be an error adding a resource:

  • When entering in the first field ("New Resource" -> "Add a Resource"), the entry will be added to "room2"
  • When entering in the second field ("New Resource" -> "Add a Resource"), the error You must specify a name. Length between 4 and 30 characters will occur in "room1"


Download the egg files, ready to be installed, from the project site here.


You can download the source code from here.


The plugin can be installed as usual, from the Trac administration panel, and requires a database upgrade.

At the moment it has been tested only on Trac 0.11 with Python 2.5.

Recent Changes

8349 by seccanj on 2010-08-10 12:55:17
New hack ResourceReservationPlugin, created by seccanj


Author: seccanj
Maintainer: seccanj

Attachments (1)

Download all attachments as: .zip