Index: openacs-4/packages/ams/tcl/ams-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ams/tcl/ams-procs-postgresql.xql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/ams/tcl/ams-procs-postgresql.xql 18 May 2005 17:11:48 -0000 1.8 +++ openacs-4/packages/ams/tcl/ams-procs-postgresql.xql 27 May 2005 09:46:49 -0000 1.9 @@ -1,87 +1,107 @@ - - - - - - select acs_attribute__create_attribute ( - :object_type, - :attribute_name, - :datatype, - :pretty_name, - :pretty_plural, - :table_name, - :column_name, - :default_value, - :min_n_values, - :max_n_values, - :sort_order, - :storage, - :static_p - ) - - - - - - select attribute_id - from acs_attributes - where object_type = :object_type - and attribute_name = :attribute_name - - - - - - select ams_attribute_value__save ( - :object_id, - :attribute_id, - :value_id - ) - - - - - - select alam.attribute_id, - alam.required_p, - alam.section_heading, - aa.attribute_name, - aa.pretty_name, - aa.widget - from ams_list_attribute_map alam, - ams_attributes aa - where alam.attribute_id = aa.attribute_id - and alam.list_id = :list_id - order by alam.sort_order - - - - - - select alam.attribute_id, - alam.required_p, - alam.section_heading, - aa.attribute_name, - aa.pretty_name, - aa.widget - from ams_list_attribute_map alam, - ams_attributes aa - where alam.attribute_id = aa.attribute_id - and alam.list_id = :list_id - order by alam.sort_order - - - - - - select aav.*, aa.attribute_name, aa.widget, aa.pretty_name, - ams_attribute_value__value(aav.attribute_id,aav.value_id) as value - from ams_attribute_values aav, - ams_attributes aa - where aav.object_id = :object_id - and aav.attribute_id = aa.attribute_id - and aa.attribute_id in ( select attribute_id from ams_list_attribute_map where list_id = :list_id ) - - - - + + + + + + select acs_attribute__create_attribute ( + :object_type, + :attribute_name, + :datatype, + :pretty_name, + :pretty_plural, + :table_name, + :column_name, + :default_value, + :min_n_values, + :max_n_values, + :sort_order, + :storage, + :static_p + ) + + + + + + select attribute_id + from acs_attributes + where object_type = :object_type + and attribute_name = :attribute_name + + + + + + select ams_attribute_value__save ( + :object_id, + :attribute_id, + :value_id + ) + + + + + + select alam.attribute_id, + alam.required_p, + alam.section_heading, + aa.attribute_name, + aa.pretty_name, + aa.widget + from ams_list_attribute_map alam, + ams_attributes aa + where alam.attribute_id = aa.attribute_id + and alam.list_id = :list_id + order by alam.sort_order + + + + + + select alam.attribute_id, + alam.required_p, + alam.section_heading, + aa.attribute_name, + aa.pretty_name, + aa.widget + from ams_list_attribute_map alam, + ams_attributes aa + where alam.attribute_id = aa.attribute_id + and alam.list_id = :list_id + order by alam.sort_order + + + + + + select aav.*, aa.attribute_name, aa.widget, aa.pretty_name, + ams_attribute_value__value(aav.attribute_id,aav.value_id) as value + from ams_attribute_values aav, + ams_attributes aa + where aav.object_id = :object_id + and aav.attribute_id = aa.attribute_id + and aa.attribute_id in ( select attribute_id from ams_list_attribute_map where list_id = :list_id ) + + + + + + select alam.attribute_id, + alam.section_heading, + aa.attribute_name, + aa.pretty_name, + aa.widget, + av.value + from ams_list_attribute_map alam, + ams_attributes aa left join ( + select ams_attribute_values.attribute_id, + ams_attribute_value__value(ams_attribute_values.attribute_id,ams_attribute_values.value_id) as value + from ams_attribute_values + where ams_attribute_values.object_id = :object_id ) av on ( aa.attribute_id = av.attribute_id ) + where alam.attribute_id = aa.attribute_id + and alam.list_id = :list_id + order by alam.sort_order + + + +