1. sidorov_panda
  2. panda_online_users

Commits

sidorov_panda  committed a817075 Draft

initial

  • Participants
  • Branches default

Comments (0)

Files changed (6)

File .hgignore

View file
+# use glob syntax.
+syntax: glob
+
+*.swp
+*.pyc
+*~

File __init__.py

Empty file added.

File middleware.py

View file
+# -*- coding:utf-8 -*-
+import datetime
+
+
+class OnlineUserMiddleware(object):
+
+    def process_request(self, request):
+        if not request.user.is_authenticated():
+            return
+        userModel = request.user.get_profile()
+        userModel.last_activity = datetime.datetime.now()
+        userModel.save()
+        return None

File models.py

Empty file added.

File tests.py

View file
+"""
+This file demonstrates writing tests using the unittest module. These will pass
+when you run "manage.py test".
+
+Replace this with more appropriate tests for your application.
+"""
+
+from django.test import TestCase
+
+
+class SimpleTest(TestCase):
+    def test_basic_addition(self):
+        """
+        Tests that 1 + 1 always equals 2.
+        """
+        self.assertEqual(1 + 1, 2)

File views.py

View file
+# Create your views here.