__sql__ and visibility:list=hidden

A place for users and developers of the Xataface to discuss and receive support.

__sql__ and visibility:list=hidden

Postby rugcutter » Thu Apr 23, 2009 9:46 pm

Hi Steve -

1st off Xataface is great stuff. Kudos to you and all your hard work.

I'm using version 1.1.5. My fields.ini has __sql__ in it. The odd thing I am seeing is that visibility:list=hidden is not being handled for all of the columns that are defined in __sql__.

Here is a section in my fields.ini :

Code: Select all
__sql__ = "select cp_id,
cc_sort_order,
cp_category_id,
cp_notes,
cp_short_description,
cp_target_date,
cp_focus,
cp_create_date,
cp_update_date
from cas_priorities cp
left join cas_categories cc
   on cp_category_id = cc_id"

[cc_sort_order]
visibility:list=hidden

[cp_id]
visibility:list=hidden


----

What I am seeing is that cc_sort_order is hidden in the list view, but cp_id is not. The pattern I am seeing is that if I set visibility:hidden for columns that are selected from the main table (cas_priorities), they still show up however for the joined table (cas_categories) the columns are hidden - as expected.

This does not happen when I do not include __sql__ in my fields.ini. The fields set visibility:list=hidden work as expected.

I put in a cheesy workaround where I wrapped the SQL in a subselect like this:

Code: Select all
__sql__ = "select *
from
(
select cp_id,
cc_sort_order,
cp_category_id,
cp_notes,
cp_short_description,
cp_target_date,
cp_focus,
cp_create_date,
cp_update_date
from cas_priorities cp
left join cas_categories cc
   on cp_category_id = cc_id
) results"


----

With my workaround the fields set visibility:list=hidden work as expected.

Any ideas?
rugcutter
 
Posts: 11
Joined: Thu Apr 23, 2009 9:43 pm

Postby shannah » Mon Apr 27, 2009 6:46 pm

One thing that it could be is that Xataface expects your __sql__ line to select ALL columns from the base table, and append additional columns as necessary. Haven't had a chance to dig into the code, but this could be what is tripping it up.

e.g.

__sql__ = "select cp.*, cc.cc_sort_order from cas_priorities cp left join cas_categories cc"
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 13 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved