uw.local.print_.db package

Submodules

uw.local.print_.db.cursor module

Cursor class for Print.

Inherits from the usual cursor class with added methods for commonly-needed queries.

class uw.local.print_.db.cursor.Cursor(connection, cursor)[source]

Bases: uw.local.dbtools.Cursor

all_jobs(**parameters)
all_requisitions(**parameters)
check_perm_admin(**parameters)
check_perm_orgunit(**parameters)
file_by_ids(**parameters)
file_query = 'select job_id, file_code, file_contents, requisition_num, requisition_title from nms_requisition_file natural join nms_requisition_plus where %s'
files_by_job(**parameters)
job_by_id(**parameters)
list_user_orgunits(**parameters)
orgunit_jobs(**parameters)
requisition_by_num(**parameters)

uw.local.print_.db.nms_requisition module

class uw.local.print_.db.nms_requisition.nms_requisition(cursor, job_id=None)[source]

Bases: object

attach_file(file_code, file_contents)[source]

Attach a file to be submitted with the requisition.

cancel()[source]

Cancel the requisition.

property cursor
property job_id
person_details(person_id)[source]
ready()[source]

Mark the requisition as ready to be submitted to New Media Services.

set_binding(stapling='none', padding=False)[source]
set_contact(person_id)[source]

Set the contact information for this requisition.

This sets the “Contact name”, “Department/organization”, “Address/room no.”, and “Phone” fields on the requisition to the values found in WatIAM for the specified person.

It does not set the “Fax” field because fax numbers are not in WatIAM. It does not set the “E-mail” field because that is used by NMS to send back the PDF requisition so this is hard-coded to the standard response address by the requisition submitting procedure.

TODO: should prune depts, rooms, phones of duplicates TODO: show phone numbers just as extensions e.g. x31234

set_copyprint(pages=None, copies=None, simplex=False, duplex=False, paper_bond=False, size_letter=False, size_legal=False, size_ledger=False, size_other=None, paper_white=False, paper_other=None, ink_black=False, ink_colour=False, ink_pantone=None)[source]
set_courier(person_id)[source]

Set the shipping for this requisition for delivery to a person.

Parameters:

person_id – the Person ID of the person who should take delivery.

This invokes set_shipping with appropriate values to request delivery to the indicated person according to their office location according to WatIAM.

set_date_required(required)[source]

Set the date required for this requisition.

Parameters:

required – the date the resulting print job is required to be done.

set_end_use(use)[source]

Set the end use for this requisition.

Parameters:

use – The end use, one of ‘administration’, ‘research’, ‘resale’,

‘teaching’, or ‘educational’.

set_flexfield(flexfield)[source]

Set the accounting flexfield to charge for this requisition.

Parameters:

flexfield – the 31-digit UW accounting flexfield.

set_instructions(instructions)[source]
set_shipping(ship_type, ship_to)[source]

Set the shipping choice for this requisition.

Parameters:

ship_type – the shipping type, one of ‘call’, ‘emailwhendone’,

‘email’, or ‘uwmail’.

ship_to – the text to fill in on the requisition for shipping

destination.

set_title(title)[source]

Set the job title for this requisition.

Parameters:

title – the title to use on the requisition.

set_value(field_code, field_value)[source]

Set a requisition field value.

Parameters:

field_code – the HTML form element ID; field_value – the value to send in the Graphics requisition.

set_value_choice(field_code, allowed_values, error_message, given_value)[source]

Set a requisition field value to one of a set of allowed values.

Parameters:

field_code – the HTML form element ID; allowed_values – the set of allowed values; error_message – error message to include if given value not allowed; given_value – the value to send in the Graphics requisition.

Intended for use by other more specific field-setting methods.

Module contents

Database interface for Print.

Modules which implement the database interface for Print.