'Default all weightings to an even spread
@ToDo: Handle deployment_settings which have Outcomes directly
attached to Projects'

def project_outcome_create_onaccept(self, form):

    db = current.db
    record_id = form.vars.id
    table = current.s3db.project_outcome
    record = db((table.id == record_id)).select(table.goal_id, limitby=(0, 1)).first()
    try:
        goal_id = record.goal_id
    except:
        error = 'Cannot    find    Project    Outcome    record    (no    record    for    this    ID),    so    cannot    setup    default    weightings'
        current.log.error(error)
        current.session.error = error
        return
    query = ((table.goal_id == goal_id) & (table.deleted == False))
    records = db(query).select(table.id)
    weighting = (1.0 / len(records))
    for r in records:
        r.update_record(weighting=weighting)
    self.project_outcome_onaccept(form, create=True)
