Commits

Anonymous committed f6bd9c8

got models finally working, created 2 controller templates

Comments (0)

Files changed (8)

CS242Registration/cs242registration/controllers/login.py

+import logging
+
+from pylons import request, response, session, tmpl_context as c
+from pylons.controllers.util import abort, redirect_to
+
+from cs242registration.lib.base import BaseController, render
+
+log = logging.getLogger(__name__)
+
+class LoginController(BaseController):
+
+    def index(self):
+        # Return a rendered template
+        #return render('/login.mako')
+        # or, return a response
+        return 'Hello World'

CS242Registration/cs242registration/controllers/registration.py

+import logging
+
+from pylons import request, response, session, tmpl_context as c
+from pylons.controllers.util import abort, redirect_to
+
+from cs242registration.lib.base import BaseController, render
+
+log = logging.getLogger(__name__)
+
+class RegistrationController(BaseController):
+
+    def index(self):
+        # Return a rendered template
+        #return render('/registration.mako')
+        # or, return a response
+        return 'Hello World'

CS242Registration/cs242registration/model/__init__.py

 """The application's model objects"""
 import elixir
 from cs242registration.model import meta
+from cs242registration.model.model import *
 
 Session = elixir.session = meta.Session
 # Uncomment if using reflected tables

CS242Registration/cs242registration/tests/functional/test_login.py

+from cs242registration.tests import *
+
+class TestLoginController(TestController):
+
+    def test_index(self):
+        response = self.app.get(url(controller='login', action='index'))
+        # Test response...

CS242Registration/cs242registration/tests/functional/test_registration.py

+from cs242registration.tests import *
+
+class TestRegistrationController(TestController):
+
+    def test_index(self):
+        response = self.app.get(url(controller='registration', action='index'))
+        # Test response...

CS242Registration/cs242registration/websetup.py

 from pylons import config
 from elixir import *
 from cs242registration import model as model
-from cs242registration.model import Moderator
+from cs242registration.model.model import Moderator
 
 def setup_app(command, conf, vars):
     """Place any commands to setup cs242registration here"""

CS242Registration/development.db

Binary file added.

CS242Registration/development.ini

 keys = generic
 
 [logger_root]
-level = INFO
+level = DEBUG
 handlers = console
 
 [logger_routes]
 qualname = cs242registration
 
 [logger_sqlalchemy]
-level = INFO
+level = DEBUG
 handlers =
 qualname = sqlalchemy.engine
 # "level = INFO" logs SQL queries.