Forum OpenACS Q&A: Response to A general-ratings package for OACS

Collapse
Posted by Don Baccus on
When you create a relationship you are, in essence, extending the basic relationship.

That extension (just as with basic object types) takes the form of a table name and key column, included in the call to acs_rel_type.create_type().

So you'd define a table like this:

create table general_ratings (
    rating_id references acs_objects ...;
    dimension_id references dimensions ...;
    user_id references users ...
    hey_we_need_a_rating_value integer;
);
then the type gets defined something like ...
begin
  acs_rel_type.create_type (
     id_column => 'rating_id',
     table_name => 'general_ratings'
  );
end;
Of course create type needs more than that but as a sketch something along these lines would seem to fit the bill, no?