Re: Getting a New CDBI object without creating one in db?

[prev] [thread] [next] [Date index for 2004/10/19]

From: Andreas Fromm
Subject: Re: Getting a New CDBI object without creating one in db?
Date: 07:13 on 19 Oct 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm in a similar situation. If you are creating forms automatically
from CDBI-objects, I mean, have an object, look for all its fields and
then generate a form with an input-field for each field in the
CDBI-object, it would be nice to have such ghost-objects, because you my
be in the nned of generating a form, but have not to generate a
db-record because the user doesn't want to insert any data.

Peter Speltz wrote:
| --- Perrin Harkins <perrin@xxxx.xxx> wrote:
|
|
|>On Thu, 2004-10-14 at 18:46, Peter Speltz wrote:
|>
|>>How do people make a CDBI object without creating one in the database?
|>
|>Typically you don't, since CDBI is an interface to your database.  If
|>you need to call methods in your CDBI classes but you don't want to
|>create any objects, then those methods are probably in the wrong place
|>(or should be class methods).
|>
|>- Perrin
|>
|
|
| In my particular situation,  I use Template Toolkit and i need/want
(and now
| have) an instance of an obj in my "new" template so that i can
populated drop
| down lists of choices and default values.   Ex: In the  customer/new
page, i
| would use "cstmr_obj.types" and cstmr_obj.default_xxx to populate a
drop down
| list and an input box.  These methods would definitely be class methods.
|
| Is there a better place to put methods like these?
| I'm basically following OO intuition. Design suggestions are very
welcome.
|
| thanks.
|
| BTW: this works
| my $obj = bless {}, CDBI::Customer;
| $tmpl_data->{cstmr_obj} = $obj;
|
| but this doesn't which was what i was doing.
| $tmpl_data->{cstmr_obj} = bless {}, CDBI::Customer;
|
|
|
|
|
|
|
| =====
| pjs
|
| __________________________________________________
| Do You Yahoo!?
| Tired of spam?  Yahoo! Mail has the best spam protection around
| http://mail.yahoo.com

- --
Grüße,

Andreas Fromm

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBdL6KUmBtSMq5cGURAm19AKDrFLwKtiqv7lIXKwTdKCF8MN41jQCfbAQ/
5K/Et9mOLdmNLNZQJP8TkRU=
=Nr1A
-----END PGP SIGNATURE-----

(message missing)

domain cross talk...?
Michael Jensen 06:47 on 06 Oct 2004

Re: domain cross talk...?
William McKee 14:41 on 06 Oct 2004

Re: domain cross talk...?
Perrin Harkins 14:47 on 06 Oct 2004

Re: domain cross talk...?
William McKee 14:51 on 06 Oct 2004

Re: domain cross talk...?
Perrin Harkins 15:06 on 06 Oct 2004

Re: domain cross talk...?
William McKee 15:32 on 06 Oct 2004

Re: domain cross talk...?
Perrin Harkins 15:36 on 06 Oct 2004

Re: domain cross talk...?
Michael Jensen 16:03 on 06 Oct 2004

Re: domain cross talk...?
Michael Jensen 16:16 on 06 Oct 2004

Re: domain cross talk...?
Perrin Harkins 16:27 on 06 Oct 2004

Re: domain cross talk...?
Carl Johnstone 23:17 on 06 Oct 2004

Re: domain cross talk...?
William McKee 15:53 on 06 Oct 2004

Re: domain cross talk...?
merlyn (Randal L. Schwartz) 16:17 on 06 Oct 2004

Re: domain cross talk...?
Perrin Harkins 16:31 on 06 Oct 2004

[CDBI] Class::DBI::Loader question
Peter Speltz 00:31 on 12 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Kingsley Kerce 02:57 on 12 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Perrin Harkins 04:12 on 12 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Kingsley Kerce 18:43 on 12 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Clayton L. Scott 17:08 on 12 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Peter Speltz 17:32 on 12 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Perrin Harkins 18:58 on 12 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Kingsley Kerce 14:26 on 14 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Perrin Harkins 15:17 on 14 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Tony Bowden 15:39 on 14 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Kingsley Kerce 14:26 on 14 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Tim Bunce 16:22 on 14 Oct 2004

Re: [CDBI] Class::DBI::Loader question
merlyn (Randal L. Schwartz) 17:24 on 14 Oct 2004

Re: Getting a New CDBI object without creating one in db?
Andreas Fromm 07:13 on 19 Oct 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52