Ejemplo n.º 1
0
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required

from cities_light.models import Country
from mozillians.users.views import (BaseProfileAdminAutocomplete, CityAutocomplete,
                                    CountryAutocomplete, RegionAutocomplete,
                                    TimeZoneAutocomplete, UsersAdminAutocomplete,
                                    VouchedAutocomplete, VoucherAutocomplete)


urlpatterns = patterns(
    '',
    # Admin urls for django-autocomplete-light.
    url('users-autocomplete/$', login_required(UsersAdminAutocomplete.as_view()),
        name='users-autocomplete'),
    url('vouchee-autocomplete/$', login_required(BaseProfileAdminAutocomplete.as_view()),
        name='vouchee-autocomplete'),
    url('voucher-autocomplete/$', login_required(VoucherAutocomplete.as_view()),
        name='voucher-autocomplete'),
    url('vouched-autocomplete/$', login_required(VouchedAutocomplete.as_view()),
        name='vouched-autocomplete'),
    url('country-autocomplete/$', login_required(CountryAutocomplete.as_view(model=Country)),
        name='country-autocomplete'),
    url('region-autocomplete/$', login_required(RegionAutocomplete.as_view()),
        name='region-autocomplete'),
    url('city-autocomplete/$', login_required(CityAutocomplete.as_view()),
        name='city-autocomplete'),
    url('timezone-autocomplete/$', login_required(TimeZoneAutocomplete.as_view()),
        name='timezone-autocomplete'),
)
Ejemplo n.º 2
0
from django.conf.urls import include, url
from django.contrib.auth.decorators import login_required

from rest_framework import routers

import mozillians.groups.api.v2
import mozillians.users.api.v2
from mozillians.users.views import VouchedAutocomplete

# API v2 URLs
router = routers.DefaultRouter()
router.register(r'users',
                mozillians.users.api.v2.UserProfileViewSet,
                base_name='userprofile')
router.register(r'groups',
                mozillians.groups.api.v2.GroupViewSet,
                base_name='group')
router.register(r'skills',
                mozillians.groups.api.v2.SkillViewSet,
                base_name='skill')

urlpatterns = [
    url(r'^v2/', include((router.urls, None)), name='v2root'),
    # Django-autocomplete-light urls
    url(r'api-v2-autocomplete/$',
        login_required(VouchedAutocomplete.as_view()),
        name='api-v2-autocomplete'),
]
Ejemplo n.º 3
0
from django.conf.urls import include, patterns, url
from django.contrib.auth.decorators import login_required

from rest_framework import routers

import mozillians.groups.api.v2
import mozillians.users.api.v2
from mozillians.users.views import VouchedAutocomplete


# API v2 URLs
router = routers.DefaultRouter()
router.register(r'users', mozillians.users.api.v2.UserProfileViewSet)
router.register(r'groups', mozillians.groups.api.v2.GroupViewSet)
router.register(r'skills', mozillians.groups.api.v2.SkillViewSet)

urlpatterns = patterns(
    '',
    url(r'^v2/', include(router.urls), name='v2root'),
    # Django-autocomplete-light urls
    url(r'api-v2-autocomplete/$', login_required(VouchedAutocomplete.as_view()),
        name='api-v2-autocomplete'),
)
Ejemplo n.º 4
0
from rest_framework import routers
from tastypie.api import Api

import mozillians.groups.api.v1
import mozillians.groups.api.v2
import mozillians.users.api.v1
import mozillians.users.api.v2
from mozillians.users.views import VouchedAutocomplete


# API v1 URLs
v1_api = Api(api_name="v1")
v1_api.register(mozillians.users.api.v1.UserResource())
v1_api.register(mozillians.groups.api.v1.GroupResource())
v1_api.register(mozillians.groups.api.v1.SkillResource())

# API v2 URLs
router = routers.DefaultRouter()
router.register(r"users", mozillians.users.api.v2.UserProfileViewSet)
router.register(r"groups", mozillians.groups.api.v2.GroupViewSet)
router.register(r"skills", mozillians.groups.api.v2.SkillViewSet)

urlpatterns = patterns(
    "",
    url(r"", include(v1_api.urls)),
    url(r"^v2/", include(router.urls), name="v2root"),
    # Django-autocomplete-light urls
    url(r"api-v2-autocomplete/$", login_required(VouchedAutocomplete.as_view()), name="api-v2-autocomplete"),
)
Ejemplo n.º 5
0
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required

from mozillians.users.views import (BaseProfileAdminAutocomplete, UsersAdminAutocomplete,
                                    VouchedAutocomplete, VoucherAutocomplete)


urlpatterns = patterns(
    '',
    # Admin urls for django-autocomplete-light.
    url('users-autocomplete/$', login_required(UsersAdminAutocomplete.as_view()),
        name='users-autocomplete'),
    url('vouchee-autocomplete/$', login_required(BaseProfileAdminAutocomplete.as_view()),
        name='vouchee-autocomplete'),
    url('voucher-autocomplete/$', login_required(VoucherAutocomplete.as_view()),
        name='voucher-autocomplete'),
    url('vouched-autocomplete/$', login_required(VouchedAutocomplete.as_view()),
        name='vouched-autocomplete'),
)