view scripts/hyperdb_example.py @ 3894:44f2158fe76e

Marek Kubica's patch to find templates installed by easy_install Adds one more place to look for templates. We already look in several places, trying to find them. This adds one more. When you install via easy_install the hierarchy ends up looking like: /usr/lib/python2.5/site-packages/roundup-1.3.3-py2.5.egg/roundup/admin.py /usr/lib/python2.5/site-packages/roundup-1.3.3-py2.5.egg/share/roundup/templates/*
author Justus Pendleton <jpend@users.sourceforge.net>
date Tue, 11 Sep 2007 04:12:17 +0000
parents d819ff1b3116
children
line wrap: on
line source

from roundup.hyperdb import String, Number, Multilink
from roundup.backends.back_bsddb import Database, Class

class config:
    DATABASE='/tmp/hyperdb_example'

db = Database(config, 'admin')
spam = Class(db, 'spam', name=String(), size=Number())
widget = Class(db, 'widget', title=String(), spam=Multilink('spam'))

oneid = spam.create(name='one', size=1)
twoid = spam.create(name='two', size=2)

widgetid = widget.create(title='a widget', spam=[oneid, twoid])

# dumb, simple query
print widget.find(spam=oneid)
print widget.history(widgetid)
print widget.search_text(

Roundup Issue Tracker: http://roundup-tracker.org/