Forum OpenACS Development: Re: ad_form for new and edit requests

Collapse
Posted by Joel Aufrecht on
If you don't use ad_form to build a display mode for a single record, what else is as simple (the state stuff notwithstanding?)  Also, there are basically two ways to look at a record: as part of a list (with sort, filter, paginate) and one record at a time (adding, editing, viewing).  So why not have, in the simple case, one declation of data, one for the list, one for the singe record?

I think the holy grail is this (in mangled pseudocode)

In the .sql creation file:

perform content_type__create_type(
    'mt_song',                    -- content_type
    'content_revision',          -- supertype
    'song',                      -- pretty_name,
    'id',                        -- id_column
);

perform content_type__create_attribute(
    'mt_song',                    -- content_type
    'artist',                      -- attribute_name
    'string',                      -- datatype
    'textbox(20)',                -- display mode
    'Artist',                      -- pretty_name
);

song_list.tcl
template::list::create_from_cr -name mt_songs -single_record_page song

song_list.adp:
<listtemplate .../>

song.tcl
template::form::create_from_cr -name mt_songs

song.adp
<formtemplate .../>

And, for added measure, we should automate url-name creation and put the index.vuh in by default so that mysite/song/jump is an alias for mysite/song?title=jump.

Collapse
Posted by Jade Rubick on
How far away are we from the holy grail? God that would be really nice...