Exemplo n.º 1
0
    def setup(self):
        self.view = DemoModelView.as_view()
        self.uri = reverse('demos')
        self.rec1 = record(
            id=1,
            # username=str(time.time()),
            json={
                'a': {
                    'b': {
                        'c': [11, 22, 33],
                        'd': 'xyz',
                        'e': 2222,
                        'f': ['aa/11', 'bb/22', 'cc/33']
                    }
                }
            }).obj

        self.rec2 = record(
            id=2,
            # fk=None,
            # username=str(time.time()),
            json={
                'a': {
                    'b': {
                        'c': [1, 2, 3],
                        'd': 'abc',
                        'e': 22,
                        'f': ['a/1', 'b/2', 'c/3']
                    }
                }
            }).obj
Exemplo n.º 2
0
    def setup(self):
        self.view = DemoModelView.as_view()
        self.uri = reverse('demos')
        self.rec1 = record(id=1,
            # username=str(time.time()),
            json={'a': {'b': {'c': [11, 22, 33],
                              'd': 'xyz',
                              'e': 2222,
                              'f': ['aa/11', 'bb/22', 'cc/33']}
                        }
                  }).obj

        self.rec2 = record(
            id=2,
            # fk=None,
            # username=str(time.time()),
            json={'a': {'b': {'c': [1, 2, 3],
                              'd': 'abc',
                              'e': 22,
                              'f': ['a/1', 'b/2', 'c/3']}
                        }
                  }).obj
Exemplo n.º 3
0
def view(rf):
    request = Request(rf.get(''))
    return DemoModelView(request=request,
                         queryset=DemoModel.objects.all(),
                         format_kwarg=None)
Exemplo n.º 4
0
 def setup(self):
     self.view = DemoModelView.as_view()
     self.uri = reverse('demos')
Exemplo n.º 5
0
 def setup(self):
     self.view = DemoModelView.as_view()
     self.uri = reverse('demos')
Exemplo n.º 6
0
from django.conf.urls import url

from demoproject.api import DemoModelView, Users

#
urlpatterns = (
    url(r'users', Users.as_view(), name='users'),
    url(r'demos', DemoModelView.as_view(), name='demos'),
)