Re: [Dbix-class] Re: Use of -resultset mandatory?

2006-10-31 Thread Aaron Crane
A. Pagaltzis writes: my $glob = do { no strict refs; \*$_ }; *$glob = sub { ... }; The temporary seems unavoidable; apparently Perl’s grammar rules (or even its semantics) are non-orthogonal here, in that it won’t permit this: *{ do { no strict refs; \*$_ } } = sub { ... };

Re: [Dbix-class] DBIx::Class::DigestColumns failes to test

2006-10-31 Thread Ash Berlin
Zbigniew Lukasiak wrote: I've looked into the issue with HTML::Widget::DBIC. At the line 49 of 100_create.t at I do: $schema-deploy({ add_drop_table = 1, }); and this should in my opinion clean the tables. In my system with SQL::Translator: 0.07 this works, and this is the latest CPAN

[Dbix-class] Combining link tables

2006-10-31 Thread Will Hawes
My database has a `file` table used to catalogue file meta info (mimetype, filename, size, etc). Over time various other tables have come to reference the file table (e.g. article, product, product_category) and I now have several link tables: article_file, product_file, product_category. I

Re: [Dbix-class] Combining link tables

2006-10-31 Thread Jules Bean
Will Hawes wrote: 1) Is this a really bad idea? Yes. 2) If not, can it be implemented with relationships, or would I need to write custom accessors or use a custom resultset class to get the desired behaviour? You'd want to patch something together with inheritance and override a few

Re: [Dbix-class] Combining link tables

2006-10-31 Thread Ash Berlin
Will Hawes wrote: My database has a `file` table used to catalogue file meta info (mimetype, filename, size, etc). Over time various other tables have come to reference the file table (e.g. article, product, product_category) and I now have several link tables: article_file, product_file,

RE: [Dbix-class] Combining link tables

2006-10-31 Thread Hermida, Leandro
Hello, Is this a really bad idea? In general I think yes it is a bad idea because you are starting to use an EAV kind of approach instead of a good relational approach which in general is not good. I don't see why you shouldn't just leave the many-to-many tables the way they are (proper

Re: [Dbix-class] Combining link tables

2006-10-31 Thread Will Hawes
Thanks all, I will refrain from doing that then ;) ___ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN:

[Dbix-class] Tests, var, and me. :-)

2006-10-31 Thread Christopher H. Laco
I just saw this post on UP: http://use.perl.org/~tomhukins/journal/31457 I had no clue that :memory: existed. Now that I do, I wonder how much faster some tests could be if we weren't creating /var/*.db for each test, even with the PRAGMA temp_store = MEMORY turned on. The upside to files is

RE: [Dbix-class] Use of -resultset mandatory?

2006-10-31 Thread Hartmaier Alexander
-Original Message- From: Shane McEwan [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 31, 2006 12:33 AM To: dbix-class@lists.rawmode.org Subject: Re: [Dbix-class] Use of -resultset mandatory? On Mon, 2006-10-30 at 21:43 +, Steven Mackenzie wrote: In my quest to avoid typing

Re: [Dbix-class] Combining link tables

2006-10-31 Thread Jason Thaxter
That cookbook example is cool. I have two databases for two applications. One takes the schema from the first, then uses table inheritance to add some columns. I'd like to inherit everything, into a full second set of proxy classes, e.g. App2::Schema inherits from App1::Schema, then just add

[Dbix-class] Using DBIx::Class with HTML::Template - anyone doing it?

2006-10-31 Thread Kevin Old
Hello everyone, I'm trying to use DBIx::Class with HTML::Template and I can't seem to get it to work. Here's how I'm calling DBIC and HTML::Template in my script: my $tmpl = HTML::Template-new( filename = single_stories.tmpl, die_on_bad_params = 1); my @stories =

Re: [Dbix-class] Using DBIx::Class with HTML::Template - anyone doing it?

2006-10-31 Thread Ash Berlin
Kevin Old wrote: Hello everyone, I'm trying to use DBIx::Class with HTML::Template and I can't seem to get it to work. Here's how I'm calling DBIC and HTML::Template in my script: my $tmpl = HTML::Template-new( filename = single_stories.tmpl, die_on_bad_params = 1); my @stories =

Re: [Dbix-class] Using DBIx::Class with HTML::Template - anyone doing it?

2006-10-31 Thread Mike Friedman
On 10/31/06, Ash Berlin [EMAIL PROTECTED] wrote: Not sure if thats a transposition error,but dont you want:if ( [EMAIL PROTECTED] ) { $tmpl-param( stories = [EMAIL PROTECTED] );print $tmpl-output;} Actually he probably wants if ( @stories ) { ... } A reference to an empty array will still be

[Dbix-class] Newcomer questions ?

2006-10-31 Thread Ivan . Georgiev
hi, I've just started using DBIx::Class and have some questions. if u can answer or point me to the right documentation ? 1. How do I do direct sql query. (I want to do TRUNCATE TABLE for now. In Class::DBI it was trought Ima::DBI afaik) 2. How can I save the classes generated from the ::Loader

Re: [Dbix-class] Using DBIx::Class with HTML::Template - anyone doing it?

2006-10-31 Thread Kevin Old
On 10/31/06, Ash Berlin [EMAIL PROTECTED] wrote: Kevin Old wrote: Hello everyone, I'm trying to use DBIx::Class with HTML::Template and I can't seem to get it to work. Here's how I'm calling DBIC and HTML::Template in my script: my $tmpl = HTML::Template-new( filename =

Re: [Dbix-class] Using DBIx::Class with HTML::Template - anyone doing it?

2006-10-31 Thread Ash Berlin
Mike Friedman wrote: On 10/31/06, *Ash Berlin* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Not sure if thats a transposition error, but dont you want: if ( [EMAIL PROTECTED] ) { $tmpl-param( stories = [EMAIL PROTECTED] ); print $tmpl-output; } Actually

[Dbix-class] Re: Combining link tables

2006-10-31 Thread A. Pagaltzis
* Will Hawes [EMAIL PROTECTED] [2006-10-31 12:35]: 1) Is this a really bad idea? If you’d tried to set up foreign keys properly you’d already know the answer… :-) Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/ ___ List:

[Dbix-class] Re: Tests, var, and me. :-)

2006-10-31 Thread A. Pagaltzis
* Christopher H. Laco [EMAIL PROTECTED] [2006-10-31 15:30]: The upside to files is that it gets completely wiped between test files. The in memory store would require a little more cleanup (DROP TABLE?) before tests run. Just close the connection at the end of a test file. The in-memory