Hi,

I just started a new project and because it might grow more complex than those 
I did before, 
I switched to Template Toolkit and Class::DBI. The advantages really look 
promising but of 
course I also found some problems/questens.

- how to effectively update records with Class::DBI? If I see it right I have 
first to retrieve an 
object to be able to do an update. I didn't find an equivalent to te sql 
"update ... where id = ?" 
that is all in one shot.

- how can I use 0-values (not NULL!) as primary key? When I try to add a record 
with the 
primary key = 0 a record is created with the next increment of the primary key. 
That looks like 
a bug to me (check on truth instead of definedness somewhere). I would like to 
use the 0-
record as default (the other records in these tables are just copies of the 
default with some 
minor adjustments).

but now more to CAP proper:
- I use a "runmode-factory" (inspired by CAP::BREAD) that creates lots of 
runmodes on the 
fly and maps them to only a few methods. This works very well -- as long as I 
don't try to do 
validation with CAP::ValidateRM. As I understand it, I can use a _runmode_ as 
error page 
but if I try this I get an error about "no object method <runmodename>". Of 
course there is no 
_method_ with the name given but why isn't the runmode used? I can hack around 
this 
problem by saving the runmode in a variable, use the right methodname as 
runmode in 
check_rm and repair everything in the called method when an error was caught. 
But all this is 
a hack I would like to avoid.

- what is a "best practice" to use error variables generated by CAP::ValidateRM 
in TT? Now I 
have something like this: First I pass $errs to the template then in the 
template (with "col" 
being a template variable holding the actual field name):
<td>[% col_e = "err_$col"; errs.$col_e %]</td>
This looks more complicated than necessary to me but I didn't find a better 
solution.

Michael


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to