Re: [Maypole] mixing of tables in create

From: Josef Chladek (j.chladek at wirtschaftsblatt.at)
Date: Tue Feb 01 2005 - 16:37:01 GMT


Am 31.01.2005 um 21:17 schrieb Peter Speltz:

>
> --- Josef Chladek <j.chladek at wirtschaftsblatt.at> wrote:
>
>> i'm fairly new to maypole, so excuse me if i'm asking something purely
>> trivial. i've been studying the docs and examples but can't figure out
>> how to realize mixing of textfields/areas from DIFFERENT tables in one
>> create/edit
>>
>> create table article (id int not null auto_increment primary key,
>> title varchar(100),
>> lead text);
>>
>> create table textblock (id int not null auto_increment primary key,
>> article integer,
>> block text);
>>
>> an article has many textblocks.
>>
>> what i want to realize is a create mask, which has
>>
>> title
>> lead
>> block [0..n]
>>
>> in it. it seems that i'm only able to create the article FIRST, and
>> then start adding blocks that i assign to the article. for an article
>> this is not the most desired workflow...
>>
>> thanks
>> josef
>>
>
> Hi josef.
>
> I assume you're using default "FromCGI::create_from_cgi" sub to
> create your
> objects. This is a limitation of that -- it doesn't create objects
> with many
> components very well.. It could probably be overriden to
> automatically add
> your blocks to the article. I'd be interested in a solution to this
> if you
> write one. I've thought about doing this for a while but haven't
> gotten around
> to it.

hello peter,

yes, i'm using the FromCGI, but as my knowledge of maypole is that of a
beginner (not to speak of CDBI) at the moment i have NO clue where to
implement that (override the do_edit? how and where could i override
the create_from_cgi? ...)

as i read on www.spanner.org
(http://www.spanner.org/lists/cdbi/2004/11/04/54ea4da4.html)

> There's been talk a few times of having Class::DBI's normal create() be
> able to take arguments for related classes as well, and do the right
> thing. Nothing's really ever come of it, but if it did, then this may
> help with your problem (rather than trying to handle it in
> create_from_cgi itself).
>
> Tony

any progress on that, or any plan to implement that in cdbi in the near
future?

thanks
josef

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:58 GMT