예제 #1
0
from biohub.core.routes import register_api, url  # noqa:F401
from rest_framework.routers import DefaultRouter

from .views import NoticeViewSet

router = DefaultRouter()

router.register(r'^notices', NoticeViewSet, base_name='notice')


register_api('', [

] + router.urls, 'notices')
예제 #2
0
router = DefaultRouter()
router.register('step', views.StepViewSet, base_name='step')
router.register('subroutine', views.SubRoutineViewSet, base_name='subroutine')
router.register('report', views.ReportViewSet, base_name='report')
router.register('label', views.LabelViewSet, base_name='label')
router.register('archive', views.ArchiveViewSet, base_name='archive')
router.register('graph', views.PictureViewSet, base_name='graph')
router.register('vars', views.UserVariableViewSet, base_name='vars')
router.register('comment', views.CommentPostSingleViewSet, base_name='comment')

comment_router = routers.NestedSimpleRouter(router,
                                            'comment',
                                            lookup='comment')
# comment_router.register(r'nameservers', views.CommentPostSingleViewSet, base_name='domain-comment')

register_api(r'^editor/', router.urls)
register_api(r'^editor/', comment_router.urls)
register_api(r'^', [
    url(r'^users/labels/(?P<user_id>[0-9]+)/$',
        views.LabelViewSet.list_user_labels),
    url(r'^users/popular-reports-list/?$',
        views.ReportViewSet.get_popular_reports),
    url(r'^reports-simple/(?P<report_id>[0-9]+)/?$',
        views.ReportViewSet.get_report_simple),
    url(r'^users/popular-reports-list/(?P<user_id>[0-9]+)/?$',
        views.ReportViewSet.get_user_popular_reports),
    url(r'^users/reports/archives/(?P<user_id>[0-9]+)/?$',
        views.ReportViewSet.get_user_archives),
    url(r'^users/reports/(?P<user_id>[0-9]+)/?$',
        views.ReportViewSet.list_user_reports,
        name='list_reports'),
예제 #3
0
from rest_framework.routers import DefaultRouter

from biohub.core.routes import register_api, url

from . import views

router = DefaultRouter()
router.register(r'users', views.UserViewSet)

register_api(r'^', [
    url(r'^users/register/$', views.register, name='register'),
    url(r'^users/login/$', views.login, name='login'),
    url(r'^users/logout/$', views.logout, name='logout'),
    url(r'^users/upload_avatar/$', views.upload_avatar, name='upload-avatar'),
    url(r'^users/change_password/$',
        views.change_password,
        name='change-password'),
    url(r'^users/reset_password/$',
        views.PasswordResetView.as_view(),
        name='reset-password'),
] + router.urls, 'accounts')

extra_router = DefaultRouter()
views.UserRelationViewSet.add_to_router(extra_router)
register_api(r'^', extra_router.urls)
예제 #4
0
from rest_framework.response import Response
from rest_framework.decorators import api_view

from biohub.core.routes import register_api, url

from .models import TestModel

register_api(r'^my_plugin/', [
    url(
        r'^$',
        api_view(['GET'])(lambda r: Response(list(TestModel.objects.all()))),
        name='index'),
    url(
        r'^hello/$',
        api_view(['GET'])(lambda r: Response('Hello')),
        name='hello')
], namespace='my_plugin')
예제 #5
0
from biohub.core.routes import register_api, register_default, url  # noqa

from .views import analyze_reverse, analyze

register_api(r'^biomap/', [
    url(r'^(?P<part_name>BBa_\w+)/analyze/$', analyze),
    url(r'^(?P<part_name>BBa_\w+)/analyze_reverse/$', analyze_reverse),
], 'biomap')
예제 #6
0
from django.conf.urls import url  # noqa
from biohub.core.routes import register_api
from rest_framework.routers import DefaultRouter
from biohub.forum.views import PostViewSet, ArticleViewSet,\
    ExperienceViewSet, ActivityViewSet, UserExperienceViewSet

from biohub.biobrick.views import BiobrickViewSet, UserBrickViewSet

router = DefaultRouter()
router.register(r'posts', PostViewSet, base_name='post')
router.register(r'articles', ArticleViewSet, base_name='article')
router.register(r'bricks', BiobrickViewSet, base_name='biobrick')
router.register(r'experiences', ExperienceViewSet, base_name='experience')
router.register(r'activities', ActivityViewSet, base_name='activity')
router.register(r'experiences/(?P<experience_id>\d+)/posts', PostViewSet, base_name='post')
ExperienceViewSet.add_to_router(router, 'experiences')


register_api(r'^forum/', router.urls, 'forum')

extra_router = DefaultRouter()
UserBrickViewSet.add_to_router(extra_router)
UserExperienceViewSet.add_to_router(extra_router)
register_api(r'^', extra_router.urls)
예제 #7
0
from biohub.core.routes import register_api, url
from rest_framework.routers import DefaultRouter

from . import views

register_api(r'^', [
    url(r'^search/', views.search, name='search'),
    url(r'^keywords/', views.keywords, name='keywords')
], 'search')
예제 #8
0
from rest_framework.routers import DefaultRouter
from biohub.core.routes import register_api, register_default, url
from biohub.community import views

router = DefaultRouter()
router.register(r'users/favorites', views.StarViewSet, base_name='favorites')
router.register(r'users/collections',
                views.CollectionViewSet,
                base_name='collections')

# Place your route definition here.
register_api(r'^', [
    url(r'^users/collect/?$', views.collect, name='collect'),
    url(r'^users/uncollect/?', views.uncollect, name='uncollect'),
    url(r'^active-users/?$',
        views.ActiveUsersViewSet.as_view(),
        name='active-users')
] + router.urls, 'community')
예제 #9
0
from biohub.core.routes import register_api, url

from .views import plugins_list, init_plugin, plugin_admin, upgrade_plugin, remove_plugin, plugin_info

register_api(r'^plugins/', [
    url(r'^$', plugins_list, name='list'),
    url(r'^init/$', init_plugin, name='init'),
    url(r'^upgrade/$', upgrade_plugin, name='upgrade'),
    url(r'^remove/$', remove_plugin, name='remove'),
    url(r'^info/$', plugin_info, name='info'),
    url(r'^__admin/$', plugin_admin, name='admin'),
],
             namespace='plugins')
예제 #10
0
from django.conf.urls import url

from biohub.core.routes import register_api

# Place your route definition here.

from . import views

register_api(
    r'^biocircuit/',
    [
        url(r'^biocircuit/(?P<string>.+)/$',
            views.BiocircuitView.as_view(),
            name='biocircuit-build'),  # the name seems wierd.
        url(r'^gates/$', views.GatesView.as_view(), name='biocircuit-gates'),
        url(r'^score/$', views.ScoreView.as_view(), name='biocircuit-score'),
    ],
    'biocircuit')
예제 #11
0
from biohub.core.routes import register_api, url
from . import views

register_api(r'^abacus/', [
    url(r'^start/$', views.StartView.as_view(), name='abacus-start'),
    url(r'^query/(?P<task_id>[0-9a-f-]+)/$',
        views.QueryView.as_view(),
        name='abacus-query'),
    url(r'^callback/$', views.CallbackView.as_view(), name='remote-callback')
], 'abacus')
예제 #12
0
from biohub.core.routes import register_api, url

from .models import AnotherModel

from rest_framework.response import Response
from rest_framework.decorators import api_view

register_api(r'^another_plugin/', [
    url(r'^$', api_view(['GET'])(
        lambda r: Response(list(AnotherModel.objects.all()))), name='index')
], namespace='another')
예제 #13
0
from biohub.core.routes import url, register_default, register_api

register_default('test/', [
    url('a/$', lambda r: None, name='a'),
],
                 namespace='test')

register_api('test/', [
    url('a/$', lambda r: None, name='a'),
],
             namespace='test')