Compare commits
10 Commits
issue-2274
...
patch-json
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b4d5fab83 | |||
|
|
ec40c1b5a9 | ||
|
|
93ef108c0b | ||
|
|
e55cf14a07 | ||
|
|
382d034fdd | ||
|
|
ee0763100b | ||
|
|
67b033d0a8 | ||
|
|
b6060ab79a | ||
|
|
66ae2a5a7f | ||
|
|
2e8a8a62f9 |
Submodule gluon/packages/dal updated: e595b921b0...24da7cbb0f
Submodule gluon/packages/yatl updated: 468c093ab0...5deb403a9e
@@ -461,7 +461,12 @@ class RadioWidget(OptionsWidget):
|
||||
opts.append(child(tds))
|
||||
|
||||
if opts:
|
||||
opts[-1][0][0]['hideerror'] = False
|
||||
opts.append(
|
||||
INPUT(requires=attr.get('requires', None),
|
||||
_style="display:none;",
|
||||
_disabled="disabled",
|
||||
_name=field.name,
|
||||
hideerror=False))
|
||||
return parent(*opts, **attr)
|
||||
|
||||
|
||||
@@ -1814,7 +1819,7 @@ class SQLFORM(FORM):
|
||||
if not field.widget and field.type.startswith('list:') and \
|
||||
not OptionsWidget.has_options(field):
|
||||
field.widget = self.widgets.list.widget
|
||||
if field.widget and fieldname in request_vars:
|
||||
if field.widget == self.widgets.list.widget and fieldname in request_vars:
|
||||
if fieldname in self.request_vars:
|
||||
value = self.request_vars[fieldname]
|
||||
elif self.record:
|
||||
|
||||
@@ -3726,7 +3726,7 @@ class Auth(AuthAPI):
|
||||
are passed to the constructor of class AuthJWT. Look there for documentation.
|
||||
"""
|
||||
if not self.jwt_handler:
|
||||
raise HTTP(400, "Not authorized")
|
||||
raise HTTP(401, "Not authorized")
|
||||
else:
|
||||
rtn = self.jwt_handler.jwt_token_manager()
|
||||
raise HTTP(200, rtn, cookies=None, **current.response.headers)
|
||||
@@ -3820,7 +3820,7 @@ class Auth(AuthAPI):
|
||||
|
||||
def allows_jwt(self, otherwise=None):
|
||||
if not self.jwt_handler:
|
||||
raise HTTP(400, "Not authorized")
|
||||
raise HTTP(401, "Not authorized")
|
||||
else:
|
||||
return self.jwt_handler.allows_jwt(otherwise=otherwise)
|
||||
|
||||
|
||||
@@ -13,6 +13,12 @@ legacy_db(legacy_db.mytable.id>0).select()
|
||||
extract_sqlite_models.py -- Copyright (C) Michele Comitini
|
||||
This code is distributed with web2py.
|
||||
|
||||
Extended version with support of
|
||||
- "ID_MYTABLE" as REFERENCE PRIMARY KEY
|
||||
- Inline CREATE TABLE declaration in sqlite DB.
|
||||
Copyright (C) Guillaume DELVIT.
|
||||
|
||||
|
||||
The regexp code and the dictionary type map was extended from
|
||||
extact_mysql_models.py that comes with web2py. extact_mysql_models.py is Copyright (C) Falko Krause.
|
||||
|
||||
@@ -58,6 +64,10 @@ def get_foreign_keys(sql_lines):
|
||||
hit = re.search(r'FOREIGN\s+KEY\s+\("(\S+)"\)\s+REFERENCES\s+"(\S+)"\s+\("(\S+)"\)', line)
|
||||
if hit:
|
||||
fks[hit.group(1)] = hit.groups()[1:]
|
||||
else:
|
||||
hit = re.search(r'ID_(\S+)\s+INTEGER', line)
|
||||
if hit:
|
||||
fks['ID_'+hit.group(1)] = [hit.group(1), 'ID']
|
||||
|
||||
return fks
|
||||
|
||||
@@ -74,6 +84,8 @@ def sqlite(database_name):
|
||||
if 'CREATE' in sql_create_stmnt: # check if the table exists
|
||||
#remove garbage lines from sql statement
|
||||
sql_lines = sql_create_stmnt.split('\n')
|
||||
if len(sql_lines) == 1 :
|
||||
sql_lines = re.split('[()\n]|, ',sql_create_stmnt)
|
||||
sql_lines = [x for x in sql_lines if not(
|
||||
x.startswith('--') or x.startswith('/*') or x == '')]
|
||||
#generate the web2py code from the create statement
|
||||
@@ -84,6 +96,8 @@ def sqlite(database_name):
|
||||
if re.search('KEY', line) or re.search('PRIMARY', line) or re.search('"ID"', line) or line.startswith(')'):
|
||||
continue
|
||||
hit = re.search(r'\[(\S+)\]\s+(\w+(\(\S+\))?),?( .*)?', line)
|
||||
if not hit:
|
||||
hit = re.search(r'(\S+)\s(\S+)', line)
|
||||
if hit is not None:
|
||||
name, d_type = hit.group(1), hit.group(2)
|
||||
d_type = re.sub(r'(\w+)\(.*', r'\1', d_type)
|
||||
|
||||
Reference in New Issue
Block a user