From d02b4448066b1f0e3a8e106f1f9513eb0a077bf0 Mon Sep 17 00:00:00 2001 From: Volodymyr Trotsyshyn Date: Sat, 24 Aug 2019 22:39:34 +0300 Subject: [PATCH] flake8 --- django_realtime_admin/__init__.py | 2 ++ django_realtime_admin/main.py | 9 ++++----- django_realtime_admin/views.py | 11 ----------- 3 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 django_realtime_admin/views.py diff --git a/django_realtime_admin/__init__.py b/django_realtime_admin/__init__.py index 08f4fca..1bccbd5 100644 --- a/django_realtime_admin/__init__.py +++ b/django_realtime_admin/__init__.py @@ -6,3 +6,5 @@ pass from django_realtime_admin.main import RealTimeModelAdmin + +__all__ = ['RealTimeModelAdmin'] diff --git a/django_realtime_admin/main.py b/django_realtime_admin/main.py index d663961..afdb8c8 100644 --- a/django_realtime_admin/main.py +++ b/django_realtime_admin/main.py @@ -26,11 +26,10 @@ def updates_pk(self, obj): def get_urls(self): info = self.model._meta.app_label, self.model._meta.model_name return [ - # specify a list of dynamic channels using formatting based on view keywords - url(r'^(?P\d+)/updates/', django_eventstream.views.events, - {'format-channels': [get_channel_name_for_model(self.model)]}, - name='%s_%s_updates' % info), - url(r'^(?P\d+)/row/', self.obj_row, name='%s_%s_row' % info) + url(r'^(?P\d+)/updates/', django_eventstream.views.events, + {'format-channels': [get_channel_name_for_model(self.model)]}, + name='%s_%s_updates' % info), + url(r'^(?P\d+)/row/', self.obj_row, name='%s_%s_row' % info) ] + super().get_urls() def obj_row(self, request, obj_id): diff --git a/django_realtime_admin/views.py b/django_realtime_admin/views.py deleted file mode 100644 index 7ad6336..0000000 --- a/django_realtime_admin/views.py +++ /dev/null @@ -1,11 +0,0 @@ -import json - -from django.core import serializers -from django.shortcuts import render -from django.views.decorators.csrf import csrf_exempt - - -def handle_model_updates(model): - def handle_updates(request): - return 1 - return handle_updates