Index: uc_node_checkout.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_node_checkout/uc_node_checkout.module,v
retrieving revision 1.8.2.11
diff -u -p -r1.8.2.11 uc_node_checkout.module
--- uc_node_checkout.module	30 Jul 2009 17:27:28 -0000	1.8.2.11
+++ uc_node_checkout.module	1 Nov 2009 04:25:36 -0000
@@ -913,3 +913,13 @@ function uc_node_checkout_load_order_pro
 
   return $products[$order_product_id];
 }
+
+/**
+ * Implementation of hook_views_api().
+ */
+function uc_node_checkout_views_api() {
+  return array(
+    'api' => 2,
+  );
+}
+
Index: uc_node_checkout.views.inc
===================================================================
RCS file: uc_node_checkout.views.inc
diff -N uc_node_checkout.views.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ uc_node_checkout.views.inc	1 Nov 2009 04:25:36 -0000
@@ -0,0 +1,44 @@
+<?php
+// $Id$
+
+/**
+ * Views integration for uc_node_checkout module.
+ *
+ * Creates a relationship between the created node and the associated order
+ * line number.
+ */
+
+/**
+ * Implementation of hook_views_data().
+ */
+function uc_node_checkout_views_data() {
+
+  // Definition for the uc_node_checkout_order_products bridge table.
+  $data['uc_node_checkout_order_products']['table']['group'] = t('UC Node Checkout');
+  $data['uc_node_checkout_order_products']['table']['join'] = array(
+    'node' => array(
+      'left_field' => 'nid',
+      'field' => 'nid',
+      'type' => 'INNER',
+    ),
+    'ucnc_order_products' => array(
+      'left_field' => 'order_product_id',
+      'field' => 'order_product_id',
+      'type' => INNER,
+    ),
+  );
+
+  $data['uc_node_checkout_order_products']['order_product_id'] = array(
+    'title' => t('UC Node Checkout order'),
+    'help' => t('Relate a purchased node to its UC Node Checkout order.'),
+    'relationship' => array(
+      'handler' => 'views_handler_relationship',
+      'base' => 'uc_order_products',
+      'base field' => 'order_product_id',
+      'field' => 'order_product_id',
+      'label' => t('UC Node Checkout order'),
+    ),
+  );
+
+  return $data;
+}
