logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

[Fwd: Re: Help/bug: Unknown column error on listing child table with foreig: msg#00001

Subject: [Fwd: Re: Help/bug: Unknown column error on listing child table with foreign keys]
Hi all,

I've released a new version, 0.8.4-b3, solving this problem and some others. You can download it from http://sourceforge.net/projects/zetadb

Regards

Santi Camps


Michael wrote:

Santi,

Thanks for the quick reply. I should also have mentioned that select_action also treats search_filter the same way as program_filter, so any fix should presumably address search_filter as well.
Thanks.

-- Michael

Santi Camps wrote:

I will work on it. It supose the problem is that this SESSION variable should be stored in dict with an entry per table SESSION['table_name']['variable']

Thanks for the information

Santi Camps


Michael wrote:

When using a parent/child schema, after listing the parent table in the upper_right frame, and clicking on 'click here' in the column with the link to the child table, I get error (1054, "Unknown column 'fk_parentID' in 'where clause'"). I should also say that the child table manager has "Field to Show" set to display a column from the parent table, requiring a lookup with the parent foreign key when displaying the child table in the lower_right frame. (And I should also say I'm using MySQL.)

On inspecting the code (including instrumenting it with LOG statements), it appears that clicking on the child table link sets a SESSION program_filter (fk_parentID = <value>) which, since it is a SESSION variable, is not cleared by the clear_request call in the child list_form when looking up the parent column value. So the SQL issued for the foreign key lookup of the parent column value when trying to list the child table has the SESSION program filter "fk_parentID = <value>" constraint in the "where" phrase, as well as the parent primary key "parent=<value>" constraint. Since fk_parentID is a child table column not in the parent table, the SQL, which is operating on the parent table, fails.

The fix would seem to be in list_form (and probably the other forms) when looking up a foreign key column to push and clear the SESSION program_filter_internal value before the

 tal:repeat="fk_record python:here.parent.select_action(params)"

foreign key lookup, and then pop the SESSION program_filter_internal value afterwords, assuming that the program_filter has been set in SESSION to hang around and be used later.

Unfortunately, I'm not enough of a Zope hacker (yet) and too new to zetadb to actually figure out a fix. It may be that I've got something misconfigured, or there might be a simpler fix than the one I've outlined.

Has anybody else had this problem, or can suggest a fix?

Thank you.

-- Michael Heathman



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
zetadb-list mailing list
zetadb-list-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/zetadb-list












-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click


<Prev in Thread] Current Thread [Next in Thread>