Skip to content

Instantly share code, notes, and snippets.

@agaerig
Created February 26, 2013 16:05
Show Gist options
  • Select an option

  • Save agaerig/5039614 to your computer and use it in GitHub Desktop.

Select an option

Save agaerig/5039614 to your computer and use it in GitHub Desktop.
from django.conf.urls.defaults import patterns, url
from django.contrib.auth.models import User
from autocomplete_utils.views import autocomplete
urlpatterns = patterns(
'',
url(r'^_ac/users-ac/$', autocomplete,
{'queryset': User.objects.filter(is_staff=True, is_active=True),
'fields': ('first_name', 'last_name', 'username')},
name='users-ac'),
url(r'^_ac/userprofiles-ac/$', autocomplete,
{'queryset': User.objects.filter(is_staff=True),
'fields': ('first_name', 'last_name', 'username')},
name='usersprofiles-ac'),
url(r'^staff/(?P<slug>[-\w]+)/$',
'users.views.user_profile', name='user-profile'),
url(r'^staff/(?P<slug>[-\w]+)/(?P<model>[-\w]+)/(?P<page>\d+)/$',
'users.views.user_profile_extended', name='user-profile-extended'),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment