[jifty-devel] Some Jifty starter questions

Rolf Schaufelberger rs at plusw.de
Fri Jul 14 04:45:45 EDT 2006


Hi, 

after playing arond a bit with jifty at the NPW in OSLO I started to have a 
closer look on it and now I have some questions and topics:
 
1. I use Postgres as my database an I'm using schemas a lot. Currently schemas 
aren't supported with jifty scheme create, yet it looks like DBIx::Schema 
doesn't support it, so it's not directly a  Jifty issue. But If DBIx::Schema 
supports this sometime it would be useful to be able to add a schema name in 
Jifty::Model::XX::Schema class. 
Using schemas requires to set a "search_path" after connecting to the db. What 
is the recommended way to add individual commants after connecting in Jifty: 
Subclassing Jifty::DBI::Handle or are there "hooks" to this stuff at the 
right place?

2. Since I already have my schema, is there a way to prevent Jifty from making 
this (english!) plural names for tables ? If I create a Schema   'XYZ' I 
would like that the table name is xyz and not xyzs.

3. Are there helper programs that can create a class file from an existing 
table ?

4. Currently I use Class::DBI, and there I have   references  has_a and 
has_many.  So 'has_a' corresponds to 'refers_to' , but how can I make the 
same like has_many ? And is there something to resolve n:m relations in a way 
like Class::DBI does ? 

5. When I create a MyModel::Model::MySchema.pm like :
(real names were PGP::Model::MParam) 

+++++++++++++++++++++++++++++++++++++
package PGP::Model::MParam::Schema;
use Jifty::DBI::Schema;
..
column width =>
 type  is 'integer',
 label is 'Breite';

column motiv =>
 type  is 'integer',
 label is 'Motiv',
 refers_to 'PGP::Model::Motiv',
1;

+++++++++++++++++++++++++++++++++++++

and I calll  jifty schema --setup I get:

ERROR - Can't locate PGP/Action/DeleteMParam.pm in @INC (@INC 
contains: /home/rs/jifty/PGP/lib /serv/perl/lib /serv/perl/lib/site_perl, /usr/local/lib/perl5/5.8.8/BSDPAN /usr/local/lib/perl5/site_perl/5.8.8/mach /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.8/mach /usr/local/lib/perl5/5.8.8 . 
Jifty::ClassLoader=HASH(0x9572ec4)) 
at /usr/local/lib/perl5/site_perl/5.8.8/Jifty/ClassLoader.pm line 197


and when I change  the last line   to

refers_to PGP::Model::Motiv,

(without ' ) I get no error but the column motiv doesn't become created.
The docs doesn't tell me wheather I shall put the class name in '' or not.

regards

Rolf Schaufelberger 
rs at plusw.de



More information about the jifty-devel mailing list