From cd81e53ef3f0f3d8335bd4e6f41095d2e8af94d9 2014-10-28 23:49:46
From: Jonathan Frederic <jon.freder@gmail.com>
Date: 2014-10-28 23:49:46
Subject: [PATCH] s/target_name/widget_class

---

diff --git a/IPython/html/static/widgets/js/manager.js b/IPython/html/static/widgets/js/manager.js
index 51b07e2..093db65 100644
--- a/IPython/html/static/widgets/js/manager.js
+++ b/IPython/html/static/widgets/js/manager.js
@@ -193,7 +193,7 @@ define([
     WidgetManager.prototype.create_model = function (options) {
         // Create and return a new widget model.
         //
-        // Minimally, one must provide the model_name and target_name
+        // Minimally, one must provide the model_name and widget_class
         // parameters to create a model from Javascript.
         //
         // Example
@@ -201,7 +201,7 @@ define([
         // JS:
         // window.slider = IPython.notebook.kernel.widget_manager.create_model({
         //      model_name: 'WidgetModel', 
-        //      target_name: 'IPython.html.widgets.widget_int.IntSlider',
+        //      widget_class: 'IPython.html.widgets.widget_int.IntSlider',
         //      init_state_callback: function(model) { console.log('Create success!', model); }});
         //
         // Parameters
@@ -210,7 +210,7 @@ define([
         //  Dictionary of options with the following contents:
         //      model_name: string
         //          Target name of the widget model to create.
-        //      target_name: (optional) string
+        //      widget_class: (optional) string
         //          Target name of the widget in the back-end.
         //      comm: (optional) Comm
         //      init_state_callback: (optional) callback
@@ -221,7 +221,7 @@ define([
         // Create a comm if it wasn't provided.
         var comm = options.comm;
         if (!comm) {
-            comm = this.comm_manager.new_comm('ipython.widget', {'target_name': options.target_name});
+            comm = this.comm_manager.new_comm('ipython.widget', {'widget_class': options.widget_class});
         }
 
         // Create and return a new model that is connected to the comm.
diff --git a/IPython/html/widgets/widget.py b/IPython/html/widgets/widget.py
index 1551b18..bd88294 100644
--- a/IPython/html/widgets/widget.py
+++ b/IPython/html/widgets/widget.py
@@ -99,8 +99,7 @@ class Widget(LoggingConfigurable):
     @staticmethod
     def handle_comm_opened(comm, msg):
         """Static method, called when a widget is constructed."""
-        target_name = msg['content']['data']['target_name']
-        widget_class = import_item(target_name)
+        widget_class = import_item(msg['content']['data']['widget_class'])
         widget = widget_class(comm=comm)