Re: set_sql, can't locate object method...
[prev]
[thread]
[next]
[Date index for 2004/09/09]
set_sql(team_list => ..) will create the methods 'sql_team_list' &
'search_team_list', and maybe others..
check the docs for more info.
cheers,
J
Michael Jensen wrote:
> 31 Table::Users->set_sql(team_list => qq{select u.* from users
> u,typist_team_members ttm where (u.id=ttm.typist_id and
> ttm.team_id=$team_id) order by u.last_name});
> 32 my @userListing = Table::Users->team_list;
>
>
> I am trying to use set_sql but I get this error:
>
> Can't locate object method "team_list" via package "Table::Users" at
> /home/webtree/home/www.acutext.com/html/i/userListing.html line 31.
>
> Any idea what is going on? I have my code as exact to the examples as I
> can think, and the sql does work fine on its own.
>
> MySQL, Perl 5.8.0, Apache, Mason, FreeBSD
>
> Nothing out of the ordinary in my base class:
>
> ...
> Table::Users->table('users');
> Table::Users->columns(Primary => qw/id/);
> Table::Users->columns(Others => qw/username password group_id
> create_date edit_date first_name last_name company_id email phone fax
> plan_type plan_limit last_login_date msg_email/);
> Table::Users->has_a(group_id=>'Table::Groups');
> Table::Users->has_a(company_id=>'Table::Companies');
> Table::Users->add_trigger(before_create => sub { $_[0]->set(create_date
> => $time) });
> 1;
>
>
> Thanks! Any help is appreciated!
>
> -Michael Jensen
|
|
Re: set_sql, can't locate object method...
Jason Galea 04:56 on 09 Sep 2004
|