[jifty-devel] Plugins and applications avalaible on Jifty

Dobrica Pavlinusic dpavlin at rot13.org
Fri May 30 14:54:16 EDT 2008

On Fri, May 30, 2008 at 12:01:55PM -0400, Jesse Vincent wrote:
> > I'm fighting subclassing Jifty::View::Declare::CRUD to support alternative
> > table-like layout and multiple values for each field (which are valid on
> > most LDAP fields, so I will probably write custom widget for that).
> Oooooh. I really want that in core. You could use it for SQL-joined
> value tables.

I don't have very elegant solution for multi-values.

First I tried to use PostgreSQL arrays for it, but Jifty::DBI didn't like
that. Then, out of despiration (and potential to use other databases) I just
joined values with magic ' <*> ' marker.

Join with magic marker sould be used for SQLite or other RDBMSes which don't
support arrays as type anyway.

This made Jifty's CRUD happy, and I liked how it's used from views.

For now, I don't have real need for indexes on those values, since I
plan to replicate same data into search engine, which will provide
results for queries on those fields.

At first sight, record filter seemed like a right way to convert arrays
into scalars, but somehow arrays got squashed before reaching filter (sorry
for poetic description, a while ago I spent a day trying to figure that
out and failed).

In the end, I overriden create in model to do magic. This way, existing
interfaces still get scalar and work.

I'm aware that it's not in 3NF but basically it's same way you would solve
tag problems if you never ever needed to search for all items with some tag
except with fulltext search :-/

So, as far as widget is concerned (if you are still reading this e-mail
:-) I planned to do editing in JavaScript, since I'm still recovering
from amount of html which gets created when I try to do proper thing
with page regions.

I'm not trying to be critical here, but from my expirince in Arh,
rendering items editor (each item has 40 fields) with multiple pictures
(each picture has 3 fields) using page regions severly limits number of
items which I can display in pager (down to 3 per page with 296 kb of

In A3C I have 36 and 76 fields for editor, and most of them can have
multiple values, so I'm looking for more lightweight approach than to
create one page region for each field.

I don't know how core-worthy this approach is, but it could degrade into
textfield with validate for non-javascript users :-)

That the current state of code, suggestions are very welcomed.

Dobrica Pavlinusic               2share!2flame            dpavlin at rot13.org
Unix addict. Internet consultant.             http://www.rot13.org/~dpavlin

More information about the jifty-devel mailing list