From shmulikav at checkpoint.com Sun Dec 3 11:12:24 2017 From: shmulikav at checkpoint.com (Shmulik Avramson) Date: Sun, 3 Dec 2017 16:12:24 +0000 Subject: [Flask] Exposing bash commands over Rest API with Flask Message-ID: Hi Flask community, I'm using Flask to expose exiting (propriety) shell commands over Rest API. Assuming I have "myCommand arg1 arg2 [arg3]" on my server, I'm exposing new API as below: URL: https:///myCommand json: { "arg1":"", "arg2":"", "arg3":"" } As I have many commands, I prepared an XML file to automate part of the process. The XML contains also validation for arguments and aggregate the API under features. An example: myCommand {arg1} {arg2} {?arg3:arg3} Now, with the above infrastructure, every person in my company can easily expose his own bash commands. What do you think on the idea? Are there any similar functionalities in Flask I can use instead of developing my own? Assuming the answer is no, do you think it worth contribution? Thank in advance :) Sam -------------- next part -------------- An HTML attachment was scrubbed... URL: From kelvin.malyar at gmail.com Sun Dec 3 11:30:54 2017 From: kelvin.malyar at gmail.com (Kelvin M) Date: Sun, 3 Dec 2017 11:30:54 -0500 Subject: [Flask] Exposing bash commands over Rest API with Flask In-Reply-To: References: Message-ID: Hi Sam, It sounds like you're going part of the way in re-inventing the OpenAPI specification for a Bash client. A quick (and i mean cursory first response) glance shows this: https://github.com/bkryza/bash-swagger-codegen I would look into that: https://swagger.io/blog/introducing-the-open-api-initiative/ Secondly, I'm not sure how Flask would help you implement bash commands unless you're just running curl commands to different endpoints. How does that work? It sounds interesting! regards, Kelvin On Sun, Dec 3, 2017 at 11:12 AM, Shmulik Avramson wrote: > Hi Flask community, > > > > I?m using Flask to expose exiting (propriety) shell commands over Rest > API. > > Assuming I have ?myCommand arg1 arg2 [arg3]? on my server, I?m exposing > new API as below: > > > > URL: https:///myCommand > json: > > { > > "arg1":??, > > "arg2":??, > > "arg3":?? > > } > > > > As I have many commands, I prepared an XML file to automate part of the > process. > > The XML contains also validation for arguments and aggregate the API under > features. > > > > An example: > > > > > > > > > > > > > > > > > > > > > > myCommand {arg1} {arg2} {?arg3:arg3} > > > > > > > > > > > Now, with the above infrastructure, every person in my company can easily > expose his own bash commands. > > > > What do you think on the idea? > > Are there any similar functionalities in Flask I can use instead of > developing my own? > > Assuming the answer is no, do you think it worth contribution? > > > > Thank in advance :) > > Sam > > > > > > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shmulikav at checkpoint.com Mon Dec 4 03:47:56 2017 From: shmulikav at checkpoint.com (Shmulik Avramson) Date: Mon, 4 Dec 2017 08:47:56 +0000 Subject: [Flask] Exposing bash commands over Rest API with Flask In-Reply-To: References: Message-ID: Hi Kelvin, Thanks for reposing. Let me clarify myself. the purpose of the XML I posted isn?t for describing my API ? it actually implements the API. As my Flask server starts, I have a parser that pars the XML and register each URL with handler that run exec with the relevant bash command. Continuing the example bellow, after my Flask parses the XML, the server is ready to accept ?https:///myCommand? with its arguments and the handler will run bash with myCommand and the args from the API call. I have hundreds of bash commands on my server, and my customers want them to be exposed over rest, with that kind of infrastructure I can easily expose the commands. What do you think? Are you familiar with similar existing infrastructure? Thank you! Sam From: Kelvin M [mailto:kelvin.malyar at gmail.com] Sent: Sunday, December 03, 2017 6:31 PM To: Shmulik Avramson Cc: flask at python.org Subject: Re: [Flask] Exposing bash commands over Rest API with Flask Hi Sam, It sounds like you're going part of the way in re-inventing the OpenAPI specification for a Bash client. A quick (and i mean cursory first response) glance shows this: https://github.com/bkryza/bash-swagger-codegen I would look into that: https://swagger.io/blog/introducing-the-open-api-initiative/ Secondly, I'm not sure how Flask would help you implement bash commands unless you're just running curl commands to different endpoints. How does that work? It sounds interesting! regards, Kelvin On Sun, Dec 3, 2017 at 11:12 AM, Shmulik Avramson > wrote: Hi Flask community, I?m using Flask to expose exiting (propriety) shell commands over Rest API. Assuming I have ?myCommand arg1 arg2 [arg3]? on my server, I?m exposing new API as below: URL: https:///myCommand json: { "arg1":??, "arg2":??, "arg3":?? } As I have many commands, I prepared an XML file to automate part of the process. The XML contains also validation for arguments and aggregate the API under features. An example: myCommand {arg1} {arg2} {?arg3:arg3} Now, with the above infrastructure, every person in my company can easily expose his own bash commands. What do you think on the idea? Are there any similar functionalities in Flask I can use instead of developing my own? Assuming the answer is no, do you think it worth contribution? Thank in advance :) Sam _______________________________________________ Flask mailing list Flask at python.org https://mail.python.org/mailman/listinfo/flask Email secured by Check Point. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kelvin.malyar at gmail.com Mon Dec 4 10:05:04 2017 From: kelvin.malyar at gmail.com (Kelvin M) Date: Mon, 4 Dec 2017 10:05:04 -0500 Subject: [Flask] Exposing bash commands over Rest API with Flask In-Reply-To: References: Message-ID: Hi Sam, I see. I haven't seen anything like that. We use Ansible (and write our own plugins for whatever we need that doesn't have a module already written). I'm still not completely clear on the use case. :) Keep me posted on how it goes. Regards, Kelvin On Mon, Dec 4, 2017 at 3:47 AM, Shmulik Avramson wrote: > Hi Kelvin, > > Thanks for reposing. > > > > Let me clarify myself. the purpose of the XML I posted isn?t for > describing my API ? it actually implements the API. > > As my Flask server starts, I have a parser that pars the XML and register > each URL with handler that run exec with the relevant bash command. > > > > Continuing the example bellow, after my Flask parses the XML, the server > is ready to accept ?https:///myCommand? with its arguments and the > handler will run > bash with myCommand and the args from the API call. > > > > I have hundreds of bash commands on my server, and my customers want them > to be exposed over rest, with that kind of infrastructure I can easily > expose the commands. > > > > What do you think? > > Are you familiar with similar existing infrastructure? > > > > Thank you! > > Sam > > > > *From:* Kelvin M [mailto:kelvin.malyar at gmail.com] > *Sent:* Sunday, December 03, 2017 6:31 PM > *To:* Shmulik Avramson > *Cc:* flask at python.org > *Subject:* Re: [Flask] Exposing bash commands over Rest API with Flask > > > > Hi Sam, > > > > It sounds like you're going part of the way in re-inventing the OpenAPI > specification for a Bash client. > > > > A quick (and i mean cursory first response) glance shows this: > https://github.com/bkryza/bash-swagger-codegen > > > > I would look into that: https://swagger.io/blog/introducing-the-open-api- > initiative/ > > > > > > Secondly, I'm not sure how Flask would help you implement bash commands > unless you're just running curl commands to different endpoints. How does > that work? It sounds interesting! > > > > regards, > > Kelvin > > > > On Sun, Dec 3, 2017 at 11:12 AM, Shmulik Avramson < > shmulikav at checkpoint.com> wrote: > > Hi Flask community, > > > > I?m using Flask to expose exiting (propriety) shell commands over Rest > API. > > Assuming I have ?myCommand arg1 arg2 [arg3]? on my server, I?m exposing > new API as below: > > > > URL: https:///myCommand > json: > > { > > "arg1":??, > > "arg2":??, > > "arg3":?? > > } > > > > As I have many commands, I prepared an XML file to automate part of the > process. > > The XML contains also validation for arguments and aggregate the API under > features. > > > > An example: > > > > > > > > > > > > > > > > > > > > > > myCommand {arg1} {arg2} {?arg3:arg3} > > > > > > > > > > > Now, with the above infrastructure, every person in my company can easily > expose his own bash commands. > > > > What do you think on the idea? > > Are there any similar functionalities in Flask I can use instead of > developing my own? > > Assuming the answer is no, do you think it worth contribution? > > > > Thank in advance :) > > Sam > > > > > > > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask > > > > > > Email secured by Check Point. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shmulikav at checkpoint.com Mon Dec 4 16:15:41 2017 From: shmulikav at checkpoint.com (Shmulik Avramson) Date: Mon, 4 Dec 2017 21:15:41 +0000 Subject: [Flask] Exposing bash commands over Rest API with Flask In-Reply-To: References: Message-ID: Hi, Ansible works over SSH and I need rest API. Sam From: Kelvin M [mailto:kelvin.malyar at gmail.com] Sent: Monday, December 04, 2017 5:05 PM To: Shmulik Avramson Cc: flask at python.org Subject: Re: [Flask] Exposing bash commands over Rest API with Flask Hi Sam, I see. I haven't seen anything like that. We use Ansible (and write our own plugins for whatever we need that doesn't have a module already written). I'm still not completely clear on the use case. :) Keep me posted on how it goes. Regards, Kelvin On Mon, Dec 4, 2017 at 3:47 AM, Shmulik Avramson > wrote: Hi Kelvin, Thanks for reposing. Let me clarify myself. the purpose of the XML I posted isn?t for describing my API ? it actually implements the API. As my Flask server starts, I have a parser that pars the XML and register each URL with handler that run exec with the relevant bash command. Continuing the example bellow, after my Flask parses the XML, the server is ready to accept ?https:///myCommand? with its arguments and the handler will run bash with myCommand and the args from the API call. I have hundreds of bash commands on my server, and my customers want them to be exposed over rest, with that kind of infrastructure I can easily expose the commands. What do you think? Are you familiar with similar existing infrastructure? Thank you! Sam From: Kelvin M [mailto:kelvin.malyar at gmail.com] Sent: Sunday, December 03, 2017 6:31 PM To: Shmulik Avramson Cc: flask at python.org Subject: Re: [Flask] Exposing bash commands over Rest API with Flask Hi Sam, It sounds like you're going part of the way in re-inventing the OpenAPI specification for a Bash client. A quick (and i mean cursory first response) glance shows this: https://github.com/bkryza/bash-swagger-codegen I would look into that: https://swagger.io/blog/introducing-the-open-api-initiative/ Secondly, I'm not sure how Flask would help you implement bash commands unless you're just running curl commands to different endpoints. How does that work? It sounds interesting! regards, Kelvin On Sun, Dec 3, 2017 at 11:12 AM, Shmulik Avramson > wrote: Hi Flask community, I?m using Flask to expose exiting (propriety) shell commands over Rest API. Assuming I have ?myCommand arg1 arg2 [arg3]? on my server, I?m exposing new API as below: URL: https:///myCommand json: { "arg1":??, "arg2":??, "arg3":?? } As I have many commands, I prepared an XML file to automate part of the process. The XML contains also validation for arguments and aggregate the API under features. An example: myCommand {arg1} {arg2} {?arg3:arg3} Now, with the above infrastructure, every person in my company can easily expose his own bash commands. What do you think on the idea? Are there any similar functionalities in Flask I can use instead of developing my own? Assuming the answer is no, do you think it worth contribution? Thank in advance :) Sam _______________________________________________ Flask mailing list Flask at python.org https://mail.python.org/mailman/listinfo/flask Email secured by Check Point. Email secured by Check Point. -------------- next part -------------- An HTML attachment was scrubbed... URL: From riteshn at gmail.com Mon Dec 4 21:29:37 2017 From: riteshn at gmail.com (Ritesh Nadhani) Date: Mon, 4 Dec 2017 18:29:37 -0800 Subject: [Flask] Change session timeout per user Message-ID: Hello I am using Flask-Security with Flask-Redis for session. Right now the user session timeout is set globally based on permanent_timeout value. Has anybody ever implemented a solution to do user level different timeout? If not can we change the timeout during runtime without restarting the whole wsgi process? -- Ritesh From shmulikav at checkpoint.com Tue Dec 12 16:36:17 2017 From: shmulikav at checkpoint.com (Shmulik Avramson) Date: Tue, 12 Dec 2017 21:36:17 +0000 Subject: [Flask] Exposing bash commands over Rest API with Flask References: Message-ID: Hi again, Does anyone can think of an existing similar infrastructure? Do you think it is worth contribution to Flask? Thank you! Sam From: Shmulik Avramson Sent: Monday, December 04, 2017 11:16 PM To: 'Kelvin M' Cc: flask at python.org Subject: RE: [Flask] Exposing bash commands over Rest API with Flask Hi, Ansible works over SSH and I need rest API. Sam From: Kelvin M [mailto:kelvin.malyar at gmail.com] Sent: Monday, December 04, 2017 5:05 PM To: Shmulik Avramson Cc: flask at python.org Subject: Re: [Flask] Exposing bash commands over Rest API with Flask Hi Sam, I see. I haven't seen anything like that. We use Ansible (and write our own plugins for whatever we need that doesn't have a module already written). I'm still not completely clear on the use case. :) Keep me posted on how it goes. Regards, Kelvin On Mon, Dec 4, 2017 at 3:47 AM, Shmulik Avramson > wrote: Hi Kelvin, Thanks for reposing. Let me clarify myself. the purpose of the XML I posted isn?t for describing my API ? it actually implements the API. As my Flask server starts, I have a parser that pars the XML and register each URL with handler that run exec with the relevant bash command. Continuing the example bellow, after my Flask parses the XML, the server is ready to accept ?https:///myCommand? with its arguments and the handler will run bash with myCommand and the args from the API call. I have hundreds of bash commands on my server, and my customers want them to be exposed over rest, with that kind of infrastructure I can easily expose the commands. What do you think? Are you familiar with similar existing infrastructure? Thank you! Sam From: Kelvin M [mailto:kelvin.malyar at gmail.com] Sent: Sunday, December 03, 2017 6:31 PM To: Shmulik Avramson Cc: flask at python.org Subject: Re: [Flask] Exposing bash commands over Rest API with Flask Hi Sam, It sounds like you're going part of the way in re-inventing the OpenAPI specification for a Bash client. A quick (and i mean cursory first response) glance shows this: https://github.com/bkryza/bash-swagger-codegen I would look into that: https://swagger.io/blog/introducing-the-open-api-initiative/ Secondly, I'm not sure how Flask would help you implement bash commands unless you're just running curl commands to different endpoints. How does that work? It sounds interesting! regards, Kelvin On Sun, Dec 3, 2017 at 11:12 AM, Shmulik Avramson > wrote: Hi Flask community, I?m using Flask to expose exiting (propriety) shell commands over Rest API. Assuming I have ?myCommand arg1 arg2 [arg3]? on my server, I?m exposing new API as below: URL: https:///myCommand json: { "arg1":??, "arg2":??, "arg3":?? } As I have many commands, I prepared an XML file to automate part of the process. The XML contains also validation for arguments and aggregate the API under features. An example: myCommand {arg1} {arg2} {?arg3:arg3} Now, with the above infrastructure, every person in my company can easily expose his own bash commands. What do you think on the idea? Are there any similar functionalities in Flask I can use instead of developing my own? Assuming the answer is no, do you think it worth contribution? Thank in advance :) Sam _______________________________________________ Flask mailing list Flask at python.org https://mail.python.org/mailman/listinfo/flask Email secured by Check Point. Email secured by Check Point. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerdakan.sa at gmail.com Wed Dec 13 00:43:02 2017 From: gerdakan.sa at gmail.com (senaps) Date: Wed, 13 Dec 2017 09:13:02 +0330 Subject: [Flask] flask-pytest throws client fixture not found Message-ID: package has a really poor documentation, i couldn't make it work. and there is nothing online for it. anybody tested their application with pytest(not with Tavern)? https://stackoverflow.com/questions/47769348/test-flask-app-using-pytest-cant-find-fixture-client this is the question on stack-overflow in case you wanted it there. https://gist.github.com/senaps/fbf05ca3d38d628f82d5301725a365c9 this is the code i used to test. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mazzei.stephen.a at gmail.com Mon Dec 18 22:29:38 2017 From: mazzei.stephen.a at gmail.com (Stephen Mazzei) Date: Mon, 18 Dec 2017 22:29:38 -0500 Subject: [Flask] (no subject) Message-ID: So I am running into an interesting error and not sure how to go about this. When running my application on my local laptop, the application runs smooth, but dies on the test virtual machine. My laptop is a 4 core, 8Gb machine, the test VM is 2 core 8GB. >From what I can tell, is on one of the pages I am pulling back about 2000 records to be displayed. On my laptop, this is fine, but it looks like this causes the VM to fail with an error code of 500 in the Apache logs. [Mon Dec 18 15:55:34.130217 2017] [core:error] [pid 2649] [client 137.183.4.126:58877] Premature end of script headers: wsgi, referer: https://hpc-mazzei.na.pg.com/webtools/usermanagement/ [Mon Dec 18 15:55:34.131654 2017] [:error] [pid 2602] [remote 137.183.4.126:6748] mod_wsgi (pid=2602): Exception occurred processing WSGI script '/data/www/flask/usermanagement/wsgi'. [Mon Dec 18 15:55:34.131725 2017] [:error] [pid 2602] [remote 137.183.4.126:6748] IOError: failed to write data I'm not to sure where to go from here, or really what I need to do. I supplied the wsgi and my Apache config below. Any help would be really appreciated. [root at vm]# cat wsgi import sys sys.path.insert(0, '/data/www/flask/usermanagement/') from usermanagement_app import usermanagement_app as application application.debug = True WSGIDaemonProcess usermanagement user=apache group=apache WSGIScriptAlias /webtools/usermanagement /data/www/flask/ usermanagement/wsgi Order deny,allow AuthBasicProvider ldap AuthLDAPURL blah blah blah AuthType Basic AuthName "Please enter Intranet username and Intranet password" Require valid-user WSGIProcessGroup usermanagement WSGIApplicationGroup %{GLOBAL} WSGIScriptReloading On AllowOverride none --- Stephen A. Mazzei Systems Administrator | AFDS, ASRC Federal Data Solutions - P&G HPC Account | 513-634-9965 <(513)%20634-9965> -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergely at polonkai.eu Tue Dec 19 00:49:37 2017 From: gergely at polonkai.eu (Gergely Polonkai) Date: Tue, 19 Dec 2017 05:49:37 +0000 Subject: [Flask] (no subject) In-Reply-To: References: Message-ID: Without a backtrace (maybe you can find it in the Apache error log), it's hard to tell. Maybe the view you were calling has a problem. The list of possible problems is still long. Best, Gergely On Tue, Dec 19, 2017, 04:29 Stephen Mazzei wrote: > So I am running into an interesting error and not sure how to go about > this. When running my application on my local laptop, the application runs > smooth, but dies on the test virtual machine. My laptop is a 4 core, 8Gb > machine, the test VM is 2 core 8GB. > > From what I can tell, is on one of the pages I am pulling back about 2000 > records to be displayed. On my laptop, this is fine, but it looks like this > causes the VM to fail with an error code of 500 in the Apache logs. > > [Mon Dec 18 15:55:34.130217 2017] [core:error] [pid 2649] [client > 137.183.4.126:58877] Premature end of script headers: wsgi, referer: > https://hpc-mazzei.na.pg.com/webtools/usermanagement/ > > [Mon Dec 18 15:55:34.131654 2017] [:error] [pid 2602] [remote > 137.183.4.126:6748] mod_wsgi (pid=2602): Exception occurred processing > WSGI script '/data/www/flask/usermanagement/wsgi'. > > [Mon Dec 18 15:55:34.131725 2017] [:error] [pid 2602] [remote > 137.183.4.126:6748] IOError: failed to write data > > > I'm not to sure where to go from here, or really what I need to do. I > supplied the wsgi and my Apache config below. Any help would be really > appreciated. > > > > [root at vm]# cat wsgi > > import sys > > sys.path.insert(0, '/data/www/flask/usermanagement/') > > > > from usermanagement_app import usermanagement_app as application > > application.debug = True > > WSGIDaemonProcess usermanagement user=apache group=apache > > WSGIScriptAlias /webtools/usermanagement > /data/www/flask/usermanagement/wsgi > > > > Order deny,allow > > AuthBasicProvider ldap > > AuthLDAPURL blah blah blah > > AuthType Basic > > AuthName "Please enter Intranet username and Intranet password" > > Require valid-user > > WSGIProcessGroup usermanagement > > WSGIApplicationGroup %{GLOBAL} > > WSGIScriptReloading On > > AllowOverride none > > > > > > > > --- > > Stephen A. Mazzei > > Systems Administrator | AFDS, ASRC Federal Data Solutions - P&G HPC > Account | 513-634-9965 <(513)%20634-9965> > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mazzei.stephen.a at gmail.com Tue Dec 19 14:43:07 2017 From: mazzei.stephen.a at gmail.com (Stephen Mazzei) Date: Tue, 19 Dec 2017 14:43:07 -0500 Subject: [Flask] (no subject) In-Reply-To: References: Message-ID: So some update to this, as I am not able to find anything on this. This appears to be a wsgi/apache issue. If I run the application manually, I do not have the issue regardless of which system I run this from. What is happening is when I click the user page, it queries the database and pulls back roughly 2000 tuples. This query is not completing. It is getting about 1/4 of the way through and then dies. What is odd that is it doesn't just die completely, it tries to do the second loop on the test database. I put a print in the code before, and can see it print the first 1/4 of the production query result, then does it again for the test, but neither one completes. If I put a sleep in the code, the code will sleep, but the results will be the same. On the HTML side, the website has already failed with the error 500. If someone can please help me with this, I would really appreciate it. I am at a complete stop until I can figure out a way to solve this problem. On Mon, Dec 18, 2017 at 10:29 PM, Stephen Mazzei wrote: > So I am running into an interesting error and not sure how to go about > this. When running my application on my local laptop, the application runs > smooth, but dies on the test virtual machine. My laptop is a 4 core, 8Gb > machine, the test VM is 2 core 8GB. > > From what I can tell, is on one of the pages I am pulling back about 2000 > records to be displayed. On my laptop, this is fine, but it looks like this > causes the VM to fail with an error code of 500 in the Apache logs. > > [Mon Dec 18 15:55:34.130217 2017] [core:error] [pid 2649] [client > 137.183.4.126:58877] Premature end of script headers: wsgi, referer: > https://hpc-mazzei.na.pg.com/webtools/usermanagement/ > > [Mon Dec 18 15:55:34.131654 2017] [:error] [pid 2602] [remote > 137.183.4.126:6748] mod_wsgi (pid=2602): Exception occurred processing > WSGI script '/data/www/flask/usermanagement/wsgi'. > > [Mon Dec 18 15:55:34.131725 2017] [:error] [pid 2602] [remote > 137.183.4.126:6748] IOError: failed to write data > > > I'm not to sure where to go from here, or really what I need to do. I > supplied the wsgi and my Apache config below. Any help would be really > appreciated. > > > > [root at vm]# cat wsgi > > import sys > > sys.path.insert(0, '/data/www/flask/usermanagement/') > > > > from usermanagement_app import usermanagement_app as application > > application.debug = True > > WSGIDaemonProcess usermanagement user=apache group=apache > > WSGIScriptAlias /webtools/usermanagement /data/www/flask/usermanagement > /wsgi > > > > Order deny,allow > > AuthBasicProvider ldap > > AuthLDAPURL blah blah blah > > AuthType Basic > > AuthName "Please enter Intranet username and Intranet password" > > Require valid-user > > WSGIProcessGroup usermanagement > > WSGIApplicationGroup %{GLOBAL} > > WSGIScriptReloading On > > AllowOverride none > > > > > > > > --- > > Stephen A. Mazzei > > Systems Administrator | AFDS, ASRC Federal Data Solutions - P&G HPC > Account | 513-634-9965 <(513)%20634-9965> > > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From 18329882237 at 163.com Wed Dec 20 22:25:36 2017 From: 18329882237 at 163.com (=?GBK?B?sLLD99Xc?=) Date: Thu, 21 Dec 2017 11:25:36 +0800 (CST) Subject: [Flask] A problem about sqlalchemy Message-ID: <25a57ffb.396e.160771adaeb.Coremail.18329882237@163.com> Does any one used sqlalchemy. When I excuse a compare query by session.query() , I always got wrong results. This photo give me a correct results by SQL. but when I use python code I got wrong. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cs at cskk.id.au Wed Dec 20 22:48:13 2017 From: cs at cskk.id.au (Cameron Simpson) Date: Thu, 21 Dec 2017 14:48:13 +1100 Subject: [Flask] A problem about sqlalchemy In-Reply-To: <25a57ffb.396e.160771adaeb.Coremail.18329882237@163.com> References: <25a57ffb.396e.160771adaeb.Coremail.18329882237@163.com> Message-ID: <20171221034813.GA72554@cskk.homeip.net> On 21Dec2017 11:25, ??? <18329882237 at 163.com> wrote: >Does any one used sqlalchemy. When I excuse a compare query by session.query() , I always got wrong results. >This photo give me a correct results by SQL. >but when I use python code I got wrong. Most of the python.org lists drop attachments; your photo is missing. Please post in plain text, and cut/paste your code into the message body. You may have more luck with an SQLAlchemy specific question on their list, over here: https://groups.google.com/group/sqlalchemy Cheers, Cameron Simpson (formerly cs at zip.com.au)