Mark Lavin  committed bf2db22

Smarter documentation references. fixes #13.

  • Participants
  • Parent commits d068ff9

Comments (0)

Files changed (4)

 Once installed you should add the urls to your root url patterns::
-    .. code-block::
         urlpatterns = patterns('',
             # Other patterns go here
             (r'^selectable/', include('selectable.urls')),

File docs/admin.rst

 a many to many relation to our `Fruit` model.
     .. literalinclude:: ../example/core/
-        :lines: 11-17
+       :pyobject: Farm
 In `` we will define the form and associate it with the `FarmAdmin`.
     .. literalinclude:: ../example/core/
-        :lines: 12-36
+        :pyobject: FarmAdminForm
+    .. literalinclude:: ../example/core/
+        :pyobject: FarmAdmin
 You'll note this form also for new users to be created and associated with the
 farm if no user is found matching the given name. To make use of this feature we
 We can even make use of the same `FarmAdminForm`.
     .. literalinclude:: ../example/core/
-        :lines: 39-48
+        :pyobject: FarmInline
+    .. literalinclude:: ../example/core/
+        :pyobject: NewUserAdmin
 The auto-complete functions will be bound as new forms are added dynamically.

File docs/lookups.rst

 should set two class attributes: `model` and `search_field`.
     .. literalinclude:: ../example/core/
-        :lines: 1-10
+        :pyobject: FruitLookup
 The syntax for `search_field` is the same as the Django 
 `field lookup syntax <>`_. 

File docs/quick-start.rst

 lookup which searchs models based on a particular field. Let's define a simple model:
     .. literalinclude:: ../example/core/
-        :lines: 1-10
+        :pyobject: Fruit
 In a `` we will define our lookup:
     .. literalinclude:: ../example/core/
-        :lines: 1-10
+        :pyobject: FruitLookup
 This lookups extends `selectable.base.ModelLookup` and defines two things: one is
 the model on which we will be searching and the other is the field which we are searching.
 Below this definition we will register our lookup class.
-    .. literalinclude:: ../example/core/
-        :lines: 12
+    .. code-block:: python
+        registry.register(FruitLookup)
 Defining Forms
 Now that we have a working lookup we will define a form which uses it:
     .. literalinclude:: ../example/core/
-        :lines: 1-13
+        :pyobject: FruitForm
+        :end-before: newautocomplete
 This replaces the default widget for the `CharField` with the `AutoCompleteWidget`.
 This will allow the user to fill this field with values taken from the names of