Ejemplo n.º 1
0
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView

from tastypie.api import Api

from events.api import EventResource, EventUpdateResource
from users.api import UserResource, RoleResource, AuthResource

admin.autodiscover()

api_v1 = Api(api_name='v1')
api_v1.register(EventResource())
api_v1.register(EventUpdateResource())
api_v1.register(UserResource())
api_v1.register(RoleResource())
api_v1.register(AuthResource())

urlpatterns = patterns(
    '',
    url(r'^$',
        TemplateView.as_view(template_name='site/index.html'),
        name='index'),
    url(r'^', include('events.urls', namespace='events')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^api/', include(api_v1.urls)),

    # Delete next line to allow logout confirmation
Ejemplo n.º 2
0
from auxiliary.api import PostResource, TagResource
from events.api import EventResource
from polyorg.api import CandidateListResource
from persons.api import PersonResource
from lobbyists.api import LobbyistsChangeResource, LobbyistResource, LobbyistCorporationResource

v2_api = Api(api_name='v2')

v2_api.register(MemberBillsResource())
v2_api.register(MemberAgendasResource())
v2_api.register(MemberResource())
v2_api.register(PartyResource())
v2_api.register(VideoResource())
v2_api.register(LinkResource())
v2_api.register(BillResource())
v2_api.register(VoteResource())
v2_api.register(VoteActionResource())
v2_api.register(LawResource())
v2_api.register(AgendaResource())
v2_api.register(AgendaTodoResource())
v2_api.register(CommitteeResource())
v2_api.register(CommitteeMeetingResource())
v2_api.register(ProtocolPartResource())
v2_api.register(PostResource())
v2_api.register(TagResource())
v2_api.register(EventResource())
v2_api.register(CandidateListResource())
v2_api.register(PersonResource())
v2_api.register(LobbyistsChangeResource())
v2_api.register(LobbyistResource())
v2_api.register(LobbyistCorporationResource())
Ejemplo n.º 3
0
from django.conf.urls import patterns, url, include
from django.http import HttpResponse
from events.api import EventResource
from .feeds import NextEventsFeed
from .ics import get_ics_of_events
from .views import EventListView

event_resource = EventResource()

urlpatterns = patterns(
    'events.views',
    url(r'^events.json$', 'get_events_in_json', name='events_json'),
    url(r'^events_for_map.json$',
        'get_events_for_map_in_json',
        name='events_for_map_json'),
    url(r'^events.rss$', NextEventsFeed(), name='events_rss'),
    url(r'^events.ics$', get_ics_of_events, name='events_ics'),
    url(r'^events.html$', EventListView.as_view(), name='events_render'),
    url(r'^location_cache.yaml$',
        lambda _: HttpResponse(
            open("events/fixtures/location_cache.yaml", "r").read()),
        name='location_cache'),
    url(r'^api/', include(event_resource.urls), name='events_api'),
)