def pg_update_or_create(self, context, values): pg_ref = db.pg_get_by_pgid(context, values['pgid']) if pg_ref: pg = db.pg_update(context, pg_ref['id'], values) else: pg = db.pg_create(context, values) return pg
def pg_update(self, context, pg_id, values): return db.pg_update(context, pg_id, values)