Skip to content

Commit 61582be

Browse files
committed
updates to get working, bumping to 0.10.0
1 parent 22d5309 commit 61582be

File tree

5 files changed

+26
-24
lines changed

5 files changed

+26
-24
lines changed

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include manage.py
55

66
include flask_xxl/templates/project/.mrbob.ini
77
include flask_xxl/templates/blueprint/.mrbob.ini
8-
recursive-include ./flask_xxl/templates *
8+
recursive-include flask_xxl/templates *
99
recursive-include flask_xxl/templates/project *
1010
recursive-include flask_xxl/templates/blueprint *
11-
11+
recursive-include flask_xxl/apps *

flask_xxl/apps/menu/urls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## TEST
2+
routes = []

flask_xxl/basemodels.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __get__(self, instance, owner):
3131

3232
Base = declarative_base()
3333

34-
34+
3535
class SQLAlchemyMissingException(Exception):
3636
pass
3737

@@ -56,7 +56,7 @@ def engine(cls):
5656
BaseMixin._engine = get_engine()
5757
BaseMixin._engine.echo = echo_sql()
5858
return BaseMixin._engine
59-
59+
6060
@declared_attr
6161
def id(self):
6262
return Column(Integer,primary_key=True)
@@ -66,17 +66,17 @@ def session(cls):
6666
if BaseMixin._session is None:
6767
BaseMixin._session = scoped_session(sessionmaker(bind=cls.engine))()
6868
return BaseMixin._session
69-
69+
7070
@classproperty
7171
def query(cls):
7272
if cls._query is None:
7373
cls._query = cls.session.query(cls)
7474
return cls._query
75-
75+
7676
@declared_attr
7777
def __tablename__(self):
7878
return underscore(pluralize(self.__name__))
79-
79+
8080
@classmethod
8181
def get_by_id(cls, id):
8282
if any(
@@ -85,9 +85,9 @@ def get_by_id(cls, id):
8585
):
8686
return cls.query.get(int(id))
8787
return None
88-
88+
8989
@classmethod
90-
def get_all(cls):
90+
def get_all(cls):
9191
return cls.query.all()
9292

9393
@classmethod
@@ -108,7 +108,7 @@ def save(self,commit=True,testing=False):
108108
except Exception, e:
109109
if not testing:
110110
raise e
111-
print e.message
111+
print e.message
112112
return False
113113
return self
114114

@@ -135,11 +135,11 @@ def get_all_columns(cls,exclude=['id']):
135135
if not attr in exclude:
136136
if not attr in [x[0] for x in rtn]:
137137
if not attr.startswith('_') and not attr.endswith('id'):
138-
if not callable(getattr(cls,attr)):
138+
if not callable(getattr(cls,attr)):
139139
rtn.append((attr,_clean_name(attr)))
140140
return rtn
141141

142-
142+
143143
class AuditMixin(object):
144144
__abstract__ = True
145145

@@ -170,7 +170,7 @@ class DBObject(object):
170170
@staticmethod
171171
def check_ctx():
172172
return stack.top is not None
173-
173+
174174
@classproperty
175175
def session(cls):
176176
sess = cls._session
@@ -180,11 +180,11 @@ def session(cls):
180180

181181
@classproperty
182182
def engine(cls):
183-
engine = cls._engine
183+
engine = cls._engine
184184
if engine is None:
185-
engine = cls._engine = cls.check_ctx() and current_app.config.get('DATABASE_URI') or os.environ.get('DATABASE_URI')
185+
engine = cls._engine = cls.check_ctx() and create_engine(current_app.config.get('DATABASE_URI') or os.environ.get('DATABASE_URI'))
186186
return engine
187-
187+
188188
@classproperty
189189
def metadata(cls):
190190
meta = cls._metadata

flask_xxl/main.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def get_app(self, app_module_name, **kwargs):
5656
self._bind_extensions()
5757
#self._register_blueprints()
5858
self._register_routes()
59-
#self._load_models()
59+
self._load_models()
6060
self._load_views()
6161
self._register_context_processors()
6262
self._register_template_filters()
@@ -153,7 +153,7 @@ def _register_blueprints(self):
153153
self._bp = {}
154154
for blueprint_path in self.app.config.get('BLUEPRINTS', []):
155155
module, b_name = self._get_imported_stuff_by_path(blueprint_path)
156-
if hasattr(module, b_name):
156+
if hasattr(module, b_name):
157157
#self.app.register_blueprint(getattr(module, b_name))
158158
self._bp[b_name] = getattr(module,b_name)
159159
if self.app.config.get('VERBOSE',False):
@@ -162,16 +162,16 @@ def _register_blueprints(self):
162162
raise NoBlueprintException('No {bp_name} blueprint found'.format(bp_name=b_name))
163163

164164
def _register_routes(self):
165-
if AppFactory._routes_registered is None:
165+
if AppFactory._routes_registered is None:
166166
AppFactory._routes_registered = True
167167
if self.app.config.get('VERBOSE',False):
168168
print 'starting routing'
169169
for url_module in self.app.config.get('URL_MODULES',[]):
170-
if self.app.config.get('VERBOSE',False):
170+
if self.app.config.get('VERBOSE',False):
171171
pass
172172
module,r_name = self._get_imported_stuff_by_path(url_module)
173173
if self.app.config.get('VERBOSE',False):
174-
pass
174+
pass
175175
if r_name == 'routes' and hasattr(module,r_name):
176176
if self.app.config.get('VERBOSE',False):
177177
print '\tsetting up routing for {} with\n\troute module {}\n'.format(module.__package__,module.__name__)
@@ -182,7 +182,7 @@ def _register_routes(self):
182182
print 'Finished registering blueprints and url routes'
183183
else:
184184
if self.app.config.get('VERBOSE',False):
185-
print 'skipped'
185+
print 'skipped'
186186

187187
def _check_for_registered_blueprint(self, bp):
188188
found = False

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = '0,9,20'
1+
VERSION = '0,10,0'
22
import os
33
from setuptools import setup, find_packages,findall
44
from glob import glob
@@ -49,7 +49,7 @@ def get_pkg_data():
4949
'WTForms==2.0.1',
5050
'Werkzeug==0.9.6',
5151
'alembic==0.6.7',
52-
'argparse==1.2.1',
52+
'argparse==1.2.1',
5353
'itsdangerous==0.24',
5454
'wsgiref==0.1.2',
5555
'six==1.8.0',

0 commit comments

Comments
 (0)