On Mon, 15 Jan 2007, Ask Bj?rn Hansen wrote:
> In our (still secret) RDBO-using project we have all the "RDBO-stuff"
> in a Foo::Model class (actually, a class for each database).
> Foo::Model::Table gets loaded (if it exists) for extra methods.
>
> Since Foo::Model is generated we only have
Ahh, found the magic.
In Rose::DB::Object::Metadata::Relationship::OneToMany I found the special
(but buried) 'query_args' variable. So this will do what I want:
relationships => [
prices => {
type => 'one to many',
class => 'Price',
colu
thanks. moving auto_initialize down worked.
However, a call to meta->relationship is not even needed since RDBO defaults to
many-to-one relationship based upon foreign keys. But, it seems this default
works only for one FK?
Consider this:
create table products (
idSERI
I am wondering if there is a way to represent conditional relationships. In
the Vendor/Product/Price tutorial example lets say I change the prices table
to look like:
CREATE TABLE prices (
id SERIAL NOT NULL PRIMARY KEY,
product_id INT NOT NULL REFERENCES products (id),
re
On Jan 15, 2007, at 3:45 PM, Robert James Kaes wrote:
[RDBO not playing nice with module reloading]
> I was rather afraid of that. :( I had hoped that someone smarter
> than I
> had come up with a work-around.
In our (still secret) RDBO-using project we have all the "RDBO-stuff"
in a Foo::M
On 1/15/07 6:46 PM, John Siracusa wrote:
> On 1/15/07 6:01 PM, Randal L. Schwartz wrote:
>> t/db-object-changes-only-2.DBD::Pg::db do failed: ERROR: syntax
>> error
>> at or near ")" at character 772
>> DBD::Pg::db do failed: ERROR: syntax error at or near ")" at character 772
>> BEGIN fa
On 1/15/07 6:28 PM, Cory Bennett wrote:
>> __PACKAGE__->meta->auto_initialize;
>> __PACKAGE__->meta->relationships(
>>product_details => {
>> type => 'one to many',
>> class => 't::ProductDetail',
>> column_map => { id => 'product_i
On 1/15/07 6:01 PM, Randal L. Schwartz wrote:
> t/db-object-changes-only-2.DBD::Pg::db do failed: ERROR: syntax error
> at or near ")" at character 772
> DBD::Pg::db do failed: ERROR: syntax error at or near ")" at character 772
> BEGIN failed--compilation aborted at t/db-object-changes-o
On Mon, 15 Jan 2007, Perrin Harkins wrote:
> On Mon, 2007-01-15 at 16:00 -0500, Robert James Kaes wrote:
> > So, a different error, but still an error when I touch the file.
>
> Sorry to say it, but not all modules work with Apache2::Reload. There
> is no official way to reload a module in perl,
> __PACKAGE__->meta->auto_initialize;
> __PACKAGE__->meta->relationships(
>product_details => {
> type => 'one to many',
> class => 't::ProductDetail',
> column_map => { id => 'product_id' },
>}
> );
In your case you ar
> Can't locate object method "add_blocks" via package "Product"
> Rose::DB::Object::AUTOLOAD('Product=HASH(0x1a7039c)', 'HASH(0x224b778)')
> called at ./product.t line 42
Doh, nevermind I found it. I was just being dumb. Based on the get/set
question that Jud asked on Friday I went of and ha
Strange, I've been struggling with exact same issue for hours today .
I've attached a test case. Fails at run time - no load time errors.
The test case contents are repeated here for reference:
SQL:
create table products (
id SERIAL PRIMARY KEY,
product_rating VARCHAR(1
> "Randal" == Randal L Schwartz writes:
> "John" == John Siracusa <[EMAIL PROTECTED]> writes:
John> Files sent to CPAN and on rose.sf.net. Change logs are below.
Randal> jsiracusa++
Randal> as always!
Uh, but was this expected
t/db-object-changes-only-2.DBD::Pg::db do fai
> "John" == John Siracusa <[EMAIL PROTECTED]> writes:
John> Files sent to CPAN and on rose.sf.net. Change logs are below.
jsiracusa++
as always!
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting
> Everything there looks right to me. One possible cause of errors like
> this may be a syntax error in a related module (e.g., Block.pm). Due
> to the way that RDBO sometimes has to defer relationship creation,
> errors in modules loaded on-demand are not always propagated. (The
> trouble is ho
On Mon, 2007-01-15 at 16:00 -0500, Robert James Kaes wrote:
> So, a different error, but still an error when I touch the file.
Sorry to say it, but not all modules work with Apache2::Reload. There
is no official way to reload a module in perl, so all it does is delete
the module from %INC, load i
On Mon, 15 Jan 2007, John Siracusa wrote:
> If you *do* want to pass arguments to the call to initialize, use the
> standard technique described in the setup() docs:
>
> __PACKAGE__->meta->setup
> (
> ...
> initialize => [ replace_existing => 1 ],
> );
John,
Thank you for
On 1/15/07, Cory Bennett <[EMAIL PROTECTED]> wrote:
> I am not sure what I am missing. I have a Product with relation like:
> blocks => {
> type => 'one to many',
> class => 'Block',
> column_map => { product_id => 'product_id' },
> },
>
> But when I try
Hello,
I am not sure what I am missing. I have a Product with relation like:
blocks => {
type => 'one to many',
class => 'Block',
column_map => { product_id => 'product_id' },
},
But when I try the "add_blocks" function it does not seem to exist:
use P
John Siracusa wrote:
> Here's the big Oracle update, plus a bunch of general bug fixes and
> some MySQL goodies. (I didn't have time to add SQL_BUFFER_RESULT, but
> that'll probably be in the next release.)
>
> Also, for anyone currently "stuffing" Rose::DB objects with $dbh
> database handles pu
Here's the big Oracle update, plus a bunch of general bug fixes and
some MySQL goodies. (I didn't have time to add SQL_BUFFER_RESULT, but
that'll probably be in the next release.)
Also, for anyone currently "stuffing" Rose::DB objects with $dbh
database handles pulled from elsewhere, your life is
On 1/14/07, Robert James Kaes <[EMAIL PROTECTED]> wrote:
> On Sat, 13 Jan 2007, Jonathan Vanasco wrote:
>> you should tail the error log to see what the exact error is
>>
>> __PACKAGE__->meta->initialize( replace_existing=> 1 );
>>
>> in each of your rdbo classes, after everything has been describe
22 matches
Mail list logo