Ejemplo n.º 1
0
class GroupActionsAPIView(djburger.ViewBase):
    csrf_exempt = True
    rules = {
        'get':
        djburger.rule(
            controller=controllers.GroupController.info,
            postvalidator=djburger.validators.constructors.ModelInstance,
            renderer=djburger.renderers.JSON(),
        ),
        'patch':
        djburger.rule(
            prevalidator=validators.GroupInputValidator,
            controller=controllers.GroupController.edit,
            postvalidator=djburger.validators.constructors.ModelInstance,
            renderer=djburger.renderers.JSON(),
        ),
        'post':
        'patch',
        'delete':
        djburger.rule(
            controller=controllers.GroupController.delete,
            postvalidator=djburger.validators.constructors.IsInt,
            renderer=djburger.renderers.JSON(),
        ),
    }
Ejemplo n.º 2
0
class IndexView(djburger.ViewBase):
    rules = {
        'get':
        djburger.rule(
            c=lambda request, data, **kwargs: 'Hello, World!',
            r=djburger.r.Template(template_name='index.html'),
        ),
    }
Ejemplo n.º 3
0
class AuthAPIView(djburger.ViewBase):
    csrf_exempt = True
    default_rule = djburger.rule(
        prev=AuthenticationForm,
        c=controllers.UserController.auth,
        postv=djburger.v.c.IsBool,
        r=djburger.r.JSON(),
    )
Ejemplo n.º 4
0
class AuthAPIView(djburger.ViewBase):
    csrf_exempt = True
    default_rule = djburger.rule(
        prevalidator=AuthenticationForm,
        controller=controllers.UserController.auth,
        postvalidator=djburger.validators.constructors.IsBool,
        renderer=djburger.renderers.JSON(),
    )
Ejemplo n.º 5
0
class GroupCommonAPIView(djburger.ViewBase):
    csrf_exempt = True
    rules = {
        'get':
        djburger.rule(
            controller=controllers.GroupController.list,
            postvalidator=djburger.validators.constructors.QuerySet,
            renderer=djburger.renderers.JSON(),
        ),
        'post':
        djburger.rule(
            prevalidator=validators.GroupInputValidator,
            controller=controllers.GroupController.add,
            postvalidator=djburger.validators.constructors.ModelInstance,
            renderer=djburger.renderers.JSON(),
        ),
        'put':
        'post',
    }
Ejemplo n.º 6
0
class GroupCommonAPIView(djburger.ViewBase):
    csrf_exempt = True
    rules = {
        'get':
        djburger.rule(
            c=controllers.GroupController.list,
            postv=djburger.v.c.QuerySet,
            r=djburger.r.JSON(),
        ),
        'post':
        djburger.rule(
            prev=validators.GroupInputValidator,
            c=controllers.GroupController.add,
            postv=djburger.v.c.ModelInstance,
            r=djburger.r.JSON(),
        ),
        'put':
        'post',
    }
Ejemplo n.º 7
0
 class Base(djburger.ViewBase):
     default_rule = djburger.rule(
         c=lambda request, data, **kwargs: data,
         postv=Validator,
         r=lambda **kwargs: kwargs,
     )
Ejemplo n.º 8
0
 class Base(djburger.ViewBase):
     default_rule = djburger.rule(
         c=lambda request, data, **kwargs: data,
         r=lambda data, **kwargs: data,
     )
Ejemplo n.º 9
0
 class Base(djburger.ViewBase):
     default_rule = djburger.rule(
         controller=lambda request, data, **kwargs: data,
         postvalidator=Validator,
         renderer=lambda **kwargs: kwargs,
     )
Ejemplo n.º 10
0
 class Base(djburger.ViewBase):
     default_rule = djburger.rule(
         parser=djburger.parsers.DictMixed(),
         controller=lambda request, data, **kwargs: data,
         renderer=lambda data, **kwargs: data,
     )