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
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
def view(rf): request = Request(rf.get('')) return DemoModelView(request=request, queryset=DemoModel.objects.all(), format_kwarg=None)
def setup(self): self.view = DemoModelView.as_view() self.uri = reverse('demos')
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'), )