2012-04-28 18:16:05 +02:00
|
|
|
from django.conf.urls.defaults import url, patterns
|
2011-11-17 12:06:48 +01:00
|
|
|
|
|
|
|
from piston.resource import Resource
|
2012-04-28 18:16:05 +02:00
|
|
|
from handlers import RootHandler, StatisticsHandler, HerdsHandler, \
|
|
|
|
CategoriesHandler, MaintainersHandler, PackagesHandler, PackageHandler
|
2011-11-17 12:06:48 +01:00
|
|
|
|
|
|
|
root_handler = Resource(handler=RootHandler)
|
|
|
|
statistics_handler = Resource(handler=StatisticsHandler)
|
|
|
|
herds_handler = Resource(handler=HerdsHandler)
|
|
|
|
categories_handler = Resource(handler=CategoriesHandler)
|
|
|
|
maintainers_handler = Resource(handler=MaintainersHandler)
|
|
|
|
packages_handler = Resource(handler=PackagesHandler)
|
|
|
|
package_handler = Resource(handler=PackageHandler)
|
|
|
|
|
2012-04-04 17:31:54 +02:00
|
|
|
urlpatterns = patterns('djeuscan.api.views',
|
2012-04-28 18:16:05 +02:00
|
|
|
url(r'^1.0/statistics\.(?P<emitter_format>.+)$', statistics_handler,
|
|
|
|
name='api.views.statistics'),
|
|
|
|
url(r'^1.0/herds\.(?P<emitter_format>.+)$', herds_handler,
|
|
|
|
name='api.views.herds'),
|
|
|
|
url(r'^1.0/categories\.(?P<emitter_format>.+)$', categories_handler,
|
|
|
|
name='api.views.categories'),
|
|
|
|
url(r'^1.0/maintainers\.(?P<emitter_format>.+)$', maintainers_handler,
|
|
|
|
name='api.views.maintainers'),
|
2011-11-17 12:06:48 +01:00
|
|
|
|
2012-04-28 18:16:05 +02:00
|
|
|
url(r'^1.0/packages/by-maintainer/(?P<maintainer_id>\d+)\.(?P<emitter_format>.+)$',
|
|
|
|
packages_handler, name='api.views.packages'),
|
2012-10-29 12:47:32 +01:00
|
|
|
url(r'^1.0/packages/by-maintainer/(?P<maintainer_email>[^/]+)\.(?P<emitter_format>.+)$',
|
|
|
|
packages_handler, name='api.views.packages'),
|
2012-04-28 18:16:05 +02:00
|
|
|
url(r'^1.0/packages/by-herd/(?P<herd>[\@\{\}\w+.-]*)\.(?P<emitter_format>.+)?$',
|
|
|
|
packages_handler, name='api.views.packages'),
|
|
|
|
url(r'^1.0/packages/by-category/(?P<category>[\w+][\w+.-]*)\.(?P<emitter_format>.+)?$',
|
|
|
|
packages_handler, name='api.views.packages'),
|
2011-11-17 12:06:48 +01:00
|
|
|
|
2012-04-28 18:16:05 +02:00
|
|
|
url(r'^1.0/package/(?P<category>[\w+][\w+.-]*)/(?P<package>[\w+][\w+.-]*)\.(?P<emitter_format>.+)$',
|
|
|
|
package_handler, name='api.views.package'),
|
2011-11-17 14:37:59 +01:00
|
|
|
|
2012-04-28 18:16:05 +02:00
|
|
|
url(r'^1.0/api\.(?P<emitter_format>.+)$',
|
|
|
|
root_handler, name='api.views.root'),
|
2011-11-17 12:06:48 +01:00
|
|
|
)
|