[html-formfu] many_to_many, again
Peter Shangov
pshangov at yahoo.com
Thu Jun 23 09:42:42 GMT 2011
Hi Alex,
Can you try with a 'Checkboxgroup' element rather than a 'Checkbox'? If this still does not work, can you post a complete working example somewhere so that we can test?
Cheers,
--
Peter
----- Original Message -----
> From: Alex Povolotsky <tarkhil at over.ru>
> To: "HTML Form Creation, Rendering and Validation Framework" <html-formfu at lists.scsys.co.uk>
> Cc:
> Sent: Wednesday, 22 June 2011, 8:22
> Subject: Re: [html-formfu] many_to_many, again
>
> On 06/20/11 11:57, Peter Shangov wrote:
>> Hi Alex,
>>
>> What is "Forum::Schema::Result::AG"? Do you mean
> "Forum::Schema::Result::AccGroup"? If so, the declaration of
> AccGroup.pm's has_many should be:
>>
>> __PACKAGE__->has_many(
>> "a_gs",
>> "Forum::Schema::Result::Account" ...
>>
> It's many_to_many. AG is a acount-group link table.
>>
>> ----- Original Message -----
>>> From: Alex Povolotsky<tarkhil at over.ru>
>>> To:
> "html-formfu at lists.scsys.co.uk"<html-formfu at lists.scsys.co.uk>
>>> Cc:
>>> Sent: Sunday, 19 June 2011, 23:09
>>> Subject: [html-formfu] many_to_many, again
>>>
>>> Hello!
>>>
>>> After a three years break, I'm trying (again) to make many_to_many
>>> relationship working. Again no success.
>>>
>>> === Account.pm ===
>>> __PACKAGE__->has_many(
>>> "a_gs",
>>> "Forum::Schema::Result::AG",
>>> { "foreign.aid" => "self.id" },
>>> { cascade_copy => 0, cascade_delete => 0 },
>>> );
>>> __PACKAGE__->many_to_many('groups', 'a_gs',
> 'gid');
>>> ===
>>>
>>> === AccGroup.pm ===
>>> __PACKAGE__->has_many(
>>> "a_gs",
>>> "Forum::Schema::Result::AG",
>>> { "foreign.gid" => "self.id" },
>>> { cascade_copy => 0, cascade_delete => 0 },
>>> );
>>>
>>> __PACKAGE__->many_to_many('accounts', 'a_gs',
> 'aid');
>>> ===
>>>
>>> === userlist.yml ===
>>> ---
>>> model_config:
>>> resultset: AccGroup
>>>
>>> indicator: submit
>>>
>>> elements:
>>> - type: Checkbox
>>> name: accounts
>>> label: Accounts
>>> model_config:
>>> resultset: Account
>>> label_column: login
>>>
>>> - type: Submit
>>> name: submit
>>>
>>> ===
>>>
>>> The code reads ALL accounts, and does not check any checkbox. I just
> don't
>>> have guts to run debugger once again.
>>>
>>> Maybe someone points me to my mistake?
>>>
>>> Alex.
>>>
>>>
>>> _______________________________________________
>>> HTML-FormFu mailing list
>>> HTML-FormFu at lists.scsys.co.uk
>>> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
>>>
>> _______________________________________________
>> HTML-FormFu mailing list
>> HTML-FormFu at lists.scsys.co.uk
>> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
>>
>
>
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
>
More information about the HTML-FormFu
mailing list