Fixes in sql connection hook
This commit is contained in:
parent
879aa66823
commit
a2481580a9
8 changed files with 57 additions and 33 deletions
|
|
@ -3,7 +3,8 @@
|
|||
#from paramecio2.libraries.db.webmodel import PhangoField
|
||||
from paramecio2.libraries.db.corefields import IntegerField
|
||||
from paramecio2.libraries.db.coreforms import SelectModelForm
|
||||
from paramecio.citoplasma.httputils import GetPostFiles
|
||||
#from paramecio.citoplasma.httputils import GetPostFiles
|
||||
from flask import request
|
||||
|
||||
class ParentField(IntegerField):
|
||||
|
||||
|
|
@ -27,9 +28,11 @@ class ParentField(IntegerField):
|
|||
if self.model!=None:
|
||||
if self.model.updated==True:
|
||||
if self.model.name_field_id in self.model.post:
|
||||
GetPostFiles.obtain_get()
|
||||
#GetPostFiles.obtain_get()
|
||||
|
||||
#model_id=GetPostFiles.get.get(self.model.name_field_id, '0')
|
||||
|
||||
model_id=GetPostFiles.get.get(self.model.name_field_id, '0')
|
||||
model_id=request.args.get(self.model.name_field_id, '0')
|
||||
|
||||
if model_id==value:
|
||||
self.error=True
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ class SqlClass:
|
|||
if self.connection['db_type']=='pymysql':
|
||||
|
||||
import pymysql.cursors
|
||||
|
||||
pymysql.install_as_MySQLdb
|
||||
SqlClass.pymysql_install=True
|
||||
SqlClass.cursors_connect=pymysql.cursors.DictCursor
|
||||
else:
|
||||
import MySQLdb.cursors
|
||||
|
|
|
|||
|
|
@ -107,6 +107,10 @@ class PTemplate:
|
|||
|
||||
self.filters[filter_name.__name__]=filter_name
|
||||
|
||||
def add_css_home_local(file_css, module):
|
||||
|
||||
pass
|
||||
|
||||
env=env_theme(__file__)
|
||||
|
||||
standard_t=PTemplate(env)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue