Commits

Germano Gabbianelli committed 54a5157

Default autocomplete view renamed "autocomplete". Forcing explict imports.

  • Participants
  • Parent commits a44a130

Comments (0)

Files changed (6)

 
 Include the view in your project's URLConf::
 
-    import autocomplete
+    from autocomplete.views import autocomplete
     
-    url('^autocomplete/', include(autocomplete.view.urls))
+    url('^autocomplete/', include(autocomplete.urls))
 
 Register a couple of ``AutocompleteSettings`` objects and start using them (for
 example in admin.py)::
     from django.contrib import admin
     from django.contrib.auth.models import Message
     
-    import autocomplete
+    from autocomplete.views import autocomplete, AutocompleteSettings
+    from autocomplete.admin import AutocompleteAdmin
     
-    class UserAutocomplete(autocomplete.AutocompleteSettings):
+    class UserAutocomplete(AutocompleteSettings):
         search_fields = ('^username', '^email')
     
-    autocomplete.view.register(Message.user, UserAutocomplete)
+    autocomplete.register(Message.user, UserAutocomplete)
     
-    class MessageAdmin(autocomplete.AutocompleteAdmin, admin.ModelAdmin):
+    class MessageAdmin(AutocompleteAdmin, admin.ModelAdmin):
         pass
     
     admin.site.register(Message, MessageAdmin)

File autocomplete/__init__.py

-from autocomplete.views import view, AutocompleteView, AutocompleteSettings
-from autocomplete.admin import AutocompleteAdmin
-from autocomplete.widgets import AutocompleteWidget, MultipleAutocompleteWidget
-from autocomplete.utils import autocomplete_formfield

File autocomplete/admin.py

 from django.core.urlresolvers import reverse
 
 from autocomplete import widgets
-from autocomplete.views import view as default_view
+from autocomplete.views import autocomplete as default_view
 from autocomplete.utils import autocomplete_formfield
 
 

File autocomplete/utils.py

 from django.db import models
 
 from autocomplete import widgets
-from autocomplete.views import view as default_view
+from autocomplete.views import autocomplete as default_view
 
 
 def autocomplete_formfield(ac_id, formfield=None, view=default_view,

File autocomplete/views.py

         return self.get_urls(), self.app_name, self.name
     urls = property(urls)
 
-view = AutocompleteView()
+autocomplete = AutocompleteView()

File autocomplete/widgets.py

 from django.utils.safestring import mark_safe
 from django.conf import settings
 
-from autocomplete.views import view as default_view
+from autocomplete.views import autocomplete as default_view
 
 
 class AutocompleteWidget(forms.Widget):