Forum OpenACS Development: Re: Calendar Create

5: Re: Calendar Create (response to 4)
Posted by Iuri Sampaio on
Database operation "0or1row" failed (exception NSINT, "Query returned more than one row.")

select calendar_id
from calendars
where owner_id = '698'
and private_p = 't'

while executing
"ns_pg_bind 0or1row nsdb0 {
select calendar_id

6: Re: Calendar Create (response to 5)
Posted by Gustaf Neumann on
Don't define the calendar as private. The definition of "private calendars" in the calendar package is not great. The baseline assumption there is that the owner has just one private calendar.

There is no definition in OpenACS that states that "the content item will never have an attachment". The basic attachment API is designed for attaching/detaching arbitrary objects to other arbitrary objects (see table definition below), while some other parts of the API and the web-interface assume content from the content repository/file storage. You should be able to use at least attach/unattach.


          Table "public.attachments"
   Column   |  Type   |       Modifiers       
 object_id  | integer | not null
 item_id    | integer | not null
 approved_p | boolean | not null default true
    "attachments_pk" PRIMARY KEY, btree (object_id, item_id)
    "attachments_item_id_idx" btree (item_id)
Foreign-key constraints:
    "attachments_item_id_fk" FOREIGN KEY (item_id) REFERENCES acs_objects(object_id) ON DELETE CASCADE
    "attachments_object_id_fk" FOREIGN KEY (object_id) REFERENCES acs_objects(object_id) ON DELETE CASCADE