honmaple 8 years ago
parent
commit
7b5d81f376
6 changed files with 13 additions and 15 deletions
  1. 1 1
      src/api/board/views.py
  2. 2 5
      src/forums/__init__.py
  3. 3 3
      src/forums/filters.py
  4. BIN
      src/forums/test.db
  5. 4 3
      src/manager.py
  6. 3 3
      src/runserver.py

+ 1 - 1
src/api/board/views.py

@@ -6,7 +6,7 @@
 # Author: jianglin
 # Email: xiyang0807@gmail.com
 # Created: 2016-12-15 22:04:05 (CST)
-# Last Update:星期三 2017-1-25 22:0:46 (CST)
+# Last Update:星期六 2017-2-18 21:38:20 (CST)
 #          By:
 # Description:
 # **************************************************************************

+ 2 - 5
src/forums/__init__.py

@@ -6,7 +6,7 @@
 # Author: jianglin
 # Email: xiyang0807@gmail.com
 # Created: 2017-01-25 20:10:50 (CST)
-# Last Update:星期三 2017-1-25 20:25:57 (CST)
+# Last Update:星期六 2017-2-18 21:42:16 (CST)
 #          By:
 # Description:
 # **************************************************************************
@@ -26,10 +26,7 @@ def create_app(config=None):
         os.path.join(os.path.dirname(__file__), os.pardir, 'static'))
 
     app = Flask(__name__, template_folder=templates, static_folder=static)
-    if config is None:
-        app.config.from_object('config.config')
-    else:
-        app.config.from_object(config)
+    app.config.from_object(config)
     register(app)
     return app
 

+ 3 - 3
src/forums/filters.py

@@ -6,7 +6,7 @@
 # Author: jianglin
 # Email: xiyang0807@gmail.com
 # Created: 2016-11-07 21:00:32 (CST)
-# Last Update:星期三 2017-1-25 20:25:57 (CST)
+# Last Update:星期六 2017-2-18 21:43:52 (CST)
 #          By:
 # Description:
 # **************************************************************************
@@ -95,7 +95,7 @@ def get_read_count(id):
 
 
 def is_collected(topicId):
-    from maple.topic.models import CollectTopic
+    from api.topic.models import CollectTopic
     from flask_login import current_user
     for collect in current_user.collects:
         cid = CollectTopic.query.filter_by(
@@ -106,7 +106,7 @@ def is_collected(topicId):
 
 
 def notice_count():
-    from maple.forums.models import Notice
+    from api.forums.models import Notice
     if g.user.is_authenticated:
         count = Notice.query.filter_by(
             rece_id=g.user.id, is_read=False).count()

BIN
src/forums/test.db


+ 4 - 3
src/manager.py

@@ -6,7 +6,7 @@
 # Author: jianglin
 # Email: xiyang0807@gmail.com
 # Created: 2016-10-25 22:08:39 (CST)
-# Last Update:星期三 2017-1-25 20:25:10 (CST)
+# Last Update:星期六 2017-2-18 21:58:48 (CST)
 #          By:
 # Description:
 # **************************************************************************
@@ -20,7 +20,7 @@ from werkzeug.security import generate_password_hash
 from datetime import datetime
 import os
 
-app = create_app()
+app = create_app('config')
 migrate = Migrate(app, db)
 manager = Manager(app)
 
@@ -55,7 +55,8 @@ def babel_update():
     pybabel = 'pybabel'
     os.system(
         pybabel +
-        ' extract -F babel.cfg -k lazy_gettext -o messages.pot forums templates')
+        ' extract -F babel.cfg -k lazy_gettext -o messages.pot forums templates'
+    )
     os.system(pybabel + ' update -i messages.pot -d translations')
     os.unlink('messages.pot')
 

+ 3 - 3
src/runserver.py

@@ -6,16 +6,16 @@
 # Author: jianglin
 # Email: xiyang0807@gmail.com
 # Created: 2016-10-25 22:01:29 (CST)
-# Last Update:星期三 2017-1-25 20:12:33 (CST)
+# Last Update:星期六 2017-2-18 21:52:8 (CST)
 #          By:
 # Description:
 # **************************************************************************
 from forums import create_app
 from werkzeug.contrib.fixers import ProxyFix
 
-app = create_app()
+app = create_app('config')
 app.wsgi_app = ProxyFix(app.wsgi_app)
 
 if __name__ == '__main__':
     app.run()
-    # print(app.url_map)
+    print(app.url_map)