Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
opendata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Participatorio
opendata
Commits
1b51d888
Commit
1b51d888
authored
10 years ago
by
Bruno Nocera Zanette
Browse files
Options
Downloads
Patches
Plain Diff
Fix "tipo_perfil" query
Fix "tipo_perfil" query
parent
454c226b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/opendata_queries_definition.py
+28
-3
28 additions, 3 deletions
lib/opendata_queries_definition.py
with
28 additions
and
3 deletions
lib/opendata_queries_definition.py
+
28
−
3
View file @
1b51d888
...
@@ -183,17 +183,27 @@ qry_post_content = \
...
@@ -183,17 +183,27 @@ qry_post_content = \
#--------------------------------------------------------------------#
#--------------------------------------------------------------------#
#--------------------------------------------------------------------#
#--------------------------------------------------------------------#
#--------------------------------------------------------------------#
# ID of metastring for acctype
acctype_id
=
None
#--------------------------------------------------------------------#
def
user_acctype
(
db
,
user_guid
):
def
user_acctype
(
db
,
user_guid
):
user_acctype
=
''
content
=
db
.
cursor
()
content
=
db
.
cursor
()
# 51477 = select * from elgg_metastrings where string='accType';
if
acctype_id
==
None
:
content
.
execute
(
qry_user_acctype
,
(
user_guid
,
51477
,))
find_acctype_id
(
db
)
if
acctype_id
==
0
:
return
user_acctype
content
.
execute
(
qry_user_acctype
,
(
user_guid
,
acctype_id
,))
if
content
.
rowcount
==
1
:
if
content
.
rowcount
==
1
:
user_acctype
=
content
.
fetchone
()[
0
]
user_acctype
=
content
.
fetchone
()[
0
]
else
:
else
:
user_acctype
=
''
print
"
ERRO! Nenhum ou Mais do que um resultado para a query
"
print
"
ERRO! Nenhum ou Mais do que um resultado para a query
"
content
.
close
()
content
.
close
()
...
@@ -201,6 +211,21 @@ def user_acctype (db, user_guid):
...
@@ -201,6 +211,21 @@ def user_acctype (db, user_guid):
return
user_acctype
return
user_acctype
#--------------------------------------------------------------------#
#--------------------------------------------------------------------#
#--------------------------------------------------------------------#
def
find_acctype_id
(
db
):
acctype_query
=
db
.
cursor
()
acctype_query
.
execute
(
"
SELECT id FROM elgg_metastrings WHERE string=
'
accType
'
LIMIT 1
"
)
global
acctype_id
if
acctype_query
.
rowcount
==
1
:
acctype_id
=
acctype_query
.
fetchone
()[
0
]
else
:
acctype_id
=
0
print
"
ERRO! Não existe
'
tipo de usuário
'
no sistema
"
acctype_query
.
close
()
#--------------------------------------------------------------------#
#--------------------------------------------------------------------#
#--------------------------------------------------------------------#
def
post_content
(
db
,
post_guid
,
content_typeid
):
def
post_content
(
db
,
post_guid
,
content_typeid
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment