[Seaside] seeking an example of a Seaside database query UI
norbert at hartl.name
Mon Oct 1 22:26:55 UTC 2012
Am 02.10.2012 um 00:03 schrieb Craig Latta <craig at netjam.org>:
> Is there an example somewhere of a simple database query UI in
> Seaside? I have a bunch of objects in a Gemstone database (in a
> GLASS-enabled extent), and I'd like to demo a UI that makes rudimentary
> queries on them (e.g., "show me all instances of this class with value X
> for field Y").
There is nothing special when using a gemstone database. Just use the collection protocol you are used to. It might not be a good idea to use allInstances in gemstone because this could be a costly operation. If you collect your instances on the class side you can do
MyClass instances select: [:each| each field = 'value1' and: [ each field2 = 'value2']]
This should be sufficient for simple queries. If your collections are getting large (>10000) there are several options in gemstone to optimize.
hope that helps,
More information about the seaside