From davidism at gmail.com Mon Sep 2 12:55:26 2019 From: davidism at gmail.com (David Lord) Date: Mon, 2 Sep 2019 09:55:26 -0700 Subject: [Flask] Extensions directory In-Reply-To: References: Message-ID: As part of moving our documentation off our custom doc server to Read the Docs, and off the pocoo domain, I made the decision to take down the old website, including the extension and snippets pages. The extensions list had been unmaintained for *years*, and the "approved" marking had lost meaning with many extensions on the list being unmaintained or deprecated in favor of other extensions. It was just too much of a hassle to keep up, and was lending a lot of weight to a very small subset of old extensions. PyPI has a "Framework :: Flask" classifier now, which extensions should use. I may bring the extension list back at some point, but I'd want it to be part of the Pallets Lektor site, and to be generalized to extensions for any of the Pallets projects. -------------- next part -------------- An HTML attachment was scrubbed... URL: From linux4ms at gmail.com Tue Sep 3 11:25:25 2019 From: linux4ms at gmail.com (Ben Duncan) Date: Tue, 3 Sep 2019 10:25:25 -0500 Subject: [Flask] FLASK_Sqlalchemy Message-ID: Ok, been trying to figure this out. Maybe someone could help. Where in flask_sqlalcehmy on can do the following to get a predefined table schema returned: class comp_table(pgdb.Model): __table__ = pgdb.Model.metadata.tables['company'] I'm trying to the same WITHOUT having to do a class along the lines of: comp_table = pgdb.Model.metadata.tables['company'] but it is not working. Is this possible and and if so, how do you code it? Thanks .. *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division -------------- next part -------------- An HTML attachment was scrubbed... URL: From coreybrett at gmail.com Mon Sep 9 09:40:38 2019 From: coreybrett at gmail.com (Corey Boyle) Date: Mon, 9 Sep 2019 09:40:38 -0400 Subject: [Flask] if/else - form handling code Message-ID: I have this in one of my views... if form.validate_on_submit(): ir.notes = form.notes.data ir.direction = form.direction.data ir.insp_date = form.insp_date.data ir.in_out_date = form.in_out_date.data ir.customer_pk = form.customer.data ir.branch_pk = form.branch.data db.session.add(ir) db.session.commit() return redirect(url_for('sales.inspectionreport', irpk=ir.pk)) else: form.notes.data = ir.notes form.direction.data = ir.direction form.insp_date.data = ir.insp_date form.in_out_date.data = ir.in_out_date form.customer.data = ir.customer_pk form.branch.data = ir.branch_pk The else does all the same assignments as the if, but in reverse order. Is there a better way to write this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergely at polonkai.eu Mon Sep 9 09:46:50 2019 From: gergely at polonkai.eu (Gergely Polonkai) Date: Mon, 9 Sep 2019 15:46:50 +0200 Subject: [Flask] if/else - form handling code In-Reply-To: References: Message-ID: Hello, Assuming it?s WTForms, you might want to take a look at form.populate_obj() (in the if branch) and form = Form(obj=ir) (before the if statement), while completely dropping tho else clause. The problem with your approach is that your else branch will trigger if a POST operation is in place, but form validation fails. In such a case, right now you drop user data and change it to the data stared in ir. If you have multiple SQLAlchemy models you may also want to look into the wforms-sqlalchemy package. Best, Gergely On Mon, 9 Sep 2019, 15:41 Corey Boyle, wrote: > I have this in one of my views... > > if form.validate_on_submit(): > ir.notes = form.notes.data > ir.direction = form.direction.data > ir.insp_date = form.insp_date.data > ir.in_out_date = form.in_out_date.data > ir.customer_pk = form.customer.data > ir.branch_pk = form.branch.data > db.session.add(ir) > db.session.commit() > return redirect(url_for('sales.inspectionreport', irpk=ir.pk)) > else: > form.notes.data = ir.notes > form.direction.data = ir.direction > form.insp_date.data = ir.insp_date > form.in_out_date.data = ir.in_out_date > form.customer.data = ir.customer_pk > form.branch.data = ir.branch_pk > > The else does all the same assignments as the if, but in reverse order. > > Is there a better way to write this? > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhysnm1964 at gmail.com Sat Sep 14 21:40:53 2019 From: mhysnm1964 at gmail.com (mhysnm1964 at gmail.com) Date: Sun, 15 Sep 2019 11:40:53 +1000 Subject: [Flask] Flask issues with JSon queries and environment variable "flask-app" problem.. Message-ID: <042301d56b66$9dcf1c50$d96d54f0$@gmail.com> Hello all, I am sure this is something simple and I am overlooking the cause of the problem. I am new to JavaScript programming and accessing data using JSon via Python. I am not a professional developer and doing this for interest sake and learning more about programming. I am creating a personal budget program for my own use using Python flask and JavaScript. The JavaScript is going to handle get and post requests. The get request is to retrieve SQL Queries in a dict or array format. Contained in the dict will be dates, strings, integers and floats only. The date is formatted in yyyy-mm-dd format. The test script I am using does not contain dates at this stage. Once I work out the cause of my issue,. then I will be modifying other functions which the query results will include dates in the Json sserialised string. The prime issue is why my JavaScript code is not retrieving the data from my flask app. The 2nd issue is why I am getting a encoding file type error. The other parts of my flask app which does not involve JavaScript work fine. Examples I have seen have the script in the HTML code and they are using ginger and flask functions to provide the URL to the JavaScript. I have done this as well with the same errors seen in the chrome debug output. I have used an absolute and relative paths with the same failure. This has been done in the JavaScript file or within the HTML code. Below is the error messages: error messages from Firefox console: WarningThe script from "http://localhost:5000/static/test_json.js" was loaded even though its MIME type ("text/plain") is not a valid JavaScript MIME type. localhost:5000 ErrorSyntaxError: missing { before function body test_json.js:31:57 WarningThe script from "http://localhost:5000/static/Accordion.js" was loaded even though its MIME type ("text/plain") is not a valid JavaScript MIME type. localhost:5000 Chrome development console: test_json.js:31 Uncaught SyntaxError: Unexpected token ) :5000/favicon.ico:1 Failed to load resource: the server responded with a status of 404 (NOT FOUND) 1. I cannot find any syntax code in the test_json.js file. 2. Do not understand why Firefox is complaining about the file type when Chrome does not. I am getting this for both .js files. 3. The Chrome error is telling me it cannot find the data request source. If I put the absolute path of "http://localhost/transactions_summary_report" into Firefox. The data comes up as a tree which you can navigate. In the Javascript I have used the same absolute path where "/transactions_summary_report" is currently with no difference with error messages. If I put the absolute path into the browser address bar, the Json data is loaded. I do not know if this is an JavaScript error or python. I have even used known working JavaScript examples with the same result. Below is the current version of the code. JavaScript code for test_json: /* standard Ajax xhr function */ function getHTTPObject() { var xhr; if (window.XMLHttpRequest) { // check for support // if it's supported, use it because it's better xhr = new XMLHttpRequest(); } else if (window.ActiveXObject) { // check for the IE 6 Ajax // save it to the xhr variable xhr = new ActiveXObject("Msxml2.XMLHTTP"); } // end if return xhr; } function ajaxCall(dataUrl, callback) { /* use our function to get the correct Ajax object based on support */ var request = getHTTPObject(); request.onreadystatechange = function () { if (this.readyState == 4 && this.status === 200) { // save the ajax response to a variable var tableData = JSON.parse(request.responseText); // make sure the callback is indeed a function before executing it if (typeof callback === "function") { callback(tableData); } // end check for function } // end ajax check } // end state check function request.open("GET", dataURl, true); request.send(); } // end function for loading ajax data ajaxCall ("/transactions_summary_report", function(data)) { console.log(data); }; The python flask view code: import re, csv, glob, os from datetime import datetime from flask import render_template, flash, redirect, url_for, request, jsonify, json, Response from app import app, db from app.forms import * from app.models import * from sqlalchemy import extract @app.route('/', methods=['GET']) @app.route('/index', methods=['GET']) def index(): tables = Accounts.query.all() return render_template('index.html', title='Budget Program Main Page', tables = tables) @app.route('/transactions_summary_report') def transactions_summary_report(): report = [] # array of dicts. # loop through all the categories. for row in SubCategories.query.join(Categories).group_by(SubCategories.category_id).all (): # create the dict to store the total of each sub-category and grand total. record = {'Category':'', 'Totals':[], 'grand_total':0} record['Category'] = row.categories.category # assigning the current category # now loop through all the sub-categories and total the values. Place them into the key total array. for subcat in SubCategories.query.filter(SubCategories.category_id == row.category_id).all(): res = Transactions.query.join(SubCategories).with_entities(SubCategories.subcatego ry, db.func.sum(Transactions.amount).label("total")).filter(Transactions.subcate gory_id == subcat.id).all() if res[-1].total is not None: # assign the sub-category total to dict. record ['Totals'] += res # end if # calculate the grand total and add to dict. res = Transactions.query.join(SubCategories).join(Categories).with_entities(db.fun c.sum(Transactions.amount).label("grand_total")).filter(SubCategories.catego ry_id == row.category_id).all() if res[-1].grand_total is not None: record['grand_total'] = res[-1].grand_total report.append(record) # assign record dict to the array # return response code plus serialise the dict. Dict does not contain dates. return jsonify(report) #return Response(json.dumps(report), mimetype='application/json') Note: I have used the last line in the above code as well with the same errors. Now for the HTMl index code: {% extends "base.html" %} {% block content %}

Total costs Per Category and Sub-Category

Transactions Summary
Category sub_Category Totals
{% endblock %} Sean Murphy SR ENGINEER.SOFTWARE ENGINEERING seanmmur at cisco.com Tel: +61 2 8446 7751 Cisco Systems, Inc. The Forum 201 Pacific Highway ST LEONARDS 2065 Australia cisco.com Think before you print. This email may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Please click here for Company Registration Information. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 21354 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.gif Type: image/gif Size: 134 bytes Desc: not available URL: From mhysnm1964 at gmail.com Sun Sep 15 19:11:14 2019 From: mhysnm1964 at gmail.com (mhysnm1964 at gmail.com) Date: Mon, 16 Sep 2019 09:11:14 +1000 Subject: [Flask] Cannot run debug mode Message-ID: <039001d56c1a$e08db330$a1a91990$@gmail.com> All, Windows 10, Python 3.6. I am having an issue with my flask app and do not understand why it does not work. If I use the flask environment variables to set debug mode. I get error messages where Flask cannot find the script. If I do not set the environment variables. It runs. The files of interest I believe are budget.py, __init__.py and routes.py. Only file modified is: ---- budget.py --- from app import app, db from app.models import * @app.shell_context_processor def make_shell_context(): return dict(db = db, Categories = Categories, SubCategories = SubCategories, Transactions = Transactions, Accounts = Accounts, DescriptionSearch = DescriptionSearch) If I have the following environments set: Set flask_app = budget.py Set flask_debug = 1 I get the following errors: WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: on * Restarting with statc: python\budget\venv\scripts\python.exe: \python\budget\venv\Scripts\flask If I change the budget.py module import statement too: from budget import app, db and remove the flask_debug environment variable. I do not get the above errors. Does anyone know why? Basically I cannot run flask in debug mode. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhysnm1964 at gmail.com Sun Sep 15 19:11:33 2019 From: mhysnm1964 at gmail.com (mhysnm1964 at gmail.com) Date: Mon, 16 Sep 2019 09:11:33 +1000 Subject: [Flask] Flask issues with JSon queries and environment variable "flask-app" problem.. In-Reply-To: References: <042301d56b66$9dcf1c50$d96d54f0$@gmail.com> Message-ID: <039501d56c1a$ebedd700$c3c98500$@gmail.com> Dennis, Thanks, refer to my new email which is the environment I am running. I will look into your email in more depth. -----Original Message----- From: Flask On Behalf Of Dennis Lee Bieber Sent: Monday, 16 September 2019 5:10 AM To: flask at python.org Subject: Re: [Flask] Flask issues with JSon queries and environment variable "flask-app" problem.. On Sun, 15 Sep 2019 11:40:53 +1000, declaimed the following: > >Examples I have seen have the script in the HTML code and they are >using ginger and flask functions to provide the URL to the JavaScript. >I have done this as well with the same errors seen in the chrome debug >output. I have used an absolute and relative paths with the same >failure. This has been done in the JavaScript file or within the HTML >code. Below is the error >messages: > > > >error messages from Firefox console: > >WarningThe script from "http://localhost:5000/static/test_json.js" was >loaded even though its MIME type ("text/plain") is not a valid >JavaScript MIME type. > >localhost:5000 ErrorSyntaxError: missing { before function body >test_json.js:31:57 > The first warning indicates the server is returning the file with a "text/plain" -- you may have to check the Flask configuration for static files to ensure the correct header is used. Are you using the Flask development server/route or are you going through something like nginx where nginx is serving the static files directly? That will affect where you have to check for MIME type settings. For the second message -- have you examined line 31 of your file? Cut&Paste into Visual Studio Code shows this for line 31: request.onreadystatechange = function () { (which, is only 47 characters long but your message identifies 57; do you have mixed tabs and spaces that got compressed when posting?) > >I do not know if this is an JavaScript error or python. I have even >used known working JavaScript examples with the same result. Below is >the current version of the code. > > > >JavaScript code for test_json: > >/* standard Ajax xhr function */ > >function getHTTPObject() { > > var xhr; > > if (window.XMLHttpRequest) { // check for support > > // if it's supported, use it because it's better > > xhr = new XMLHttpRequest(); > > } else if (window.ActiveXObject) { // check for the IE 6 Ajax > > // save it to the xhr variable > > xhr = new ActiveXObject("Msxml2.XMLHTTP"); > > } // end if > > return xhr; > >} > >function ajaxCall(dataUrl, callback) { > > /* use our function to get the correct Ajax object based on support > */ > > var request = getHTTPObject(); > > request.onreadystatechange = function () { > > if (this.readyState == 4 && this.status === 200) { > > // save the ajax response to a variable > > var tableData = JSON.parse(request.responseText); > > // make sure the callback is indeed a function before >executing it > > if (typeof callback === "function") { > > callback(tableData); > > } // end check for function > > } // end ajax check > > } // end state check function > > request.open("GET", dataURl, true); > > request.send(); > >} // end function for loading ajax data > >ajaxCall ("/transactions_summary_report", function(data)) { > > console.log(data); > > }; > I'm not a JS person but that looks rather odd to me... That looks like an invocation of "ajaxCall", passing a string, and whatever "data" is after I'm guessing a type coercion to function. I don't know where "data" is coming from. However, IF that IS an invocation, what is the { console.log(data); }; supposed to be? Are you trying to pass an anonymous function? Maybe you want ajaxCall ("/transactions_summary_report", function (data) { console.log(data); }; ); to make the stuff inside {} the body of the anonymous function. AH! there is a help... If I remove all the blank lines from your source (it would help, in the future, if you adjust your posting client to NOT double space when you paste code... -=-=-=- /* standard Ajax xhr function */ function getHTTPObject() { var xhr; if (window.XMLHttpRequest) { // check for support // if it's supported, use it because it's better xhr = new XMLHttpRequest(); } else if (window.ActiveXObject) { // check for the IE 6 Ajax // save it to the xhr variable xhr = new ActiveXObject("Msxml2.XMLHTTP"); } // end if return xhr; } function ajaxCall(dataUrl, callback) { /* use our function to get the correct Ajax object based on support */ var request = getHTTPObject(); request.onreadystatechange = function () { if (this.readyState == 4 && this.status === 200) { // save the ajax response to a variable var tableData = JSON.parse(request.responseText); // make sure the callback is indeed a function before executing it if (typeof callback === "function") { callback(tableData); } // end check for function } // end ajax check } // end state check function request.open("GET", dataURl, true); request.send(); } // end function for loading ajax data ajaxCall ("/transactions_summary_report", function(data)) { console.log(data); }; -=-=-=- Makes the line ajaxCall(... #29, and column 57 is the second ")". And yes, that fits the error message in that the ")" is being seen as what would be the body of the function definition which is lacking the "{" to start it. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed at ix.netcom.com http://wlfraed.microdiversity.freeddns.org/ _______________________________________________ Flask mailing list Flask at python.org https://mail.python.org/mailman/listinfo/flask From stappers at stappers.nl Mon Sep 16 01:21:51 2019 From: stappers at stappers.nl (Geert Stappers) Date: Mon, 16 Sep 2019 07:21:51 +0200 Subject: [Flask] Cannot run debug mode In-Reply-To: <039001d56c1a$e08db330$a1a91990$@gmail.com> References: <039001d56c1a$e08db330$a1a91990$@gmail.com> Message-ID: <20190916052151.qyoakt5ypy6tg5cx@gpm.stappers.nl> On Mon, Sep 16, 2019 at 09:11:14AM +1000, mhysnm1964 at gmail.com wrote: > All, > > Windows 10, Python 3.6. > > > > I am having an issue with my flask app and do not understand why it does not > work. If I use the flask environment variables to set debug mode. I get > error messages where Flask cannot find the script. If I do not set the > environment variables. It runs. Sounds to me like that full path of script must be set. > ... > If I have the following environments set: > > > > Set flask_app = budget.py > > Set flask_debug = 1 > > > > I get the following errors: > > > > WARNING: This is a development server. Do not use it in a production > deployment. Use a production WSGI server > instead. That warning is not an error ... Groeten Geert Stappers -- Leven en laten leven From linux4ms at gmail.com Mon Sep 16 15:59:58 2019 From: linux4ms at gmail.com (Ben Duncan) Date: Mon, 16 Sep 2019 14:59:58 -0500 Subject: [Flask] User Groups Message-ID: Anyone know if there is a wtforms user group ? Thanks ... *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division -------------- next part -------------- An HTML attachment was scrubbed... URL: From flebber.crue at gmail.com Mon Sep 16 21:53:37 2019 From: flebber.crue at gmail.com (Sayth Renshaw) Date: Tue, 17 Sep 2019 11:53:37 +1000 Subject: [Flask] Flask debug, vscode - attaching firefox Message-ID: Hi I am hoping others are using vscode with flask. having trouble melding 2 doc pages. My goal is to launch the debugger for flask and open in firefox. I have setup launch as in the vscode article. { "version": "0.2.0", "configurations": [ { "name": "Python: Flask", "type": "python", "request": "launch", "module": "flask", "env": { "FLASK_APP": "app.py", }, "args": [ "run", ], "jinja": true }, ] } However, I cannot get firefox to attach as well, as its a different type. Has anyone set this up? Docs referred to: firefox debug https://marketplace.visualstudio.com/items?itemName=firefox-devtools.vscode-firefox-debug Vscode debug - https://marketplace.visualstudio.com/items?itemName=firefox-devtools.vscode-firefox-debug Sayth -------------- next part -------------- An HTML attachment was scrubbed... URL: From stappers at stappers.nl Tue Sep 17 00:48:51 2019 From: stappers at stappers.nl (Geert Stappers) Date: Tue, 17 Sep 2019 06:48:51 +0200 Subject: [Flask] Flask debug, vscode - attaching firefox In-Reply-To: References: Message-ID: <20190917044851.wi2y6iqw46x5bzxd@gpm.stappers.nl> On Tue, Sep 17, 2019 at 11:53:37AM +1000, Sayth Renshaw wrote: > Hi > > I am hoping others are using vscode with flask. > having trouble melding 2 doc pages. My goal is to launch the debugger for > flask and open in firefox. > > I have setup launch as in the vscode article. > > { > "version": "0.2.0", > "configurations": [ > { > "name": "Python: Flask", > "type": "python", > "request": "launch", > "module": "flask", > "env": { > "FLASK_APP": "app.py", > }, > "args": [ > "run", > > ], > "jinja": true > }, > ] > } > > However, I cannot get firefox to attach as well, as its a different type. > Has anyone set this up? > > Docs referred to: > firefox debug > https://marketplace.visualstudio.com/items?itemName=firefox-devtools.vscode-firefox-debug > > Vscode debug - > https://marketplace.visualstudio.com/items?itemName=firefox-devtools.vscode-firefox-debug > Why the duplicate URL when the label differ? Groeten Geert Stappers -- Leven en laten leven From davidism at gmail.com Tue Sep 17 12:52:16 2019 From: davidism at gmail.com (David Lord) Date: Tue, 17 Sep 2019 09:52:16 -0700 Subject: [Flask] User Groups In-Reply-To: References: Message-ID: There is not, but you're welcome to use this list or our discord server if you have questions about using it with flask On Mon, Sep 16, 2019, 13:00 Ben Duncan wrote: > Anyone know if there is a wtforms user group ? > > Thanks ... > > *Ben Duncan* > DBA / Chief Software Architect > Mississippi State Supreme Court > Electronic Filing Division > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask > -------------- next part -------------- An HTML attachment was scrubbed... URL: From linux4ms at gmail.com Tue Sep 17 15:55:05 2019 From: linux4ms at gmail.com (Ben Duncan) Date: Tue, 17 Sep 2019 14:55:05 -0500 Subject: [Flask] User Groups In-Reply-To: References: Message-ID: Ok, cool. Really having fun with flask/wtforms ... *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division On Tue, Sep 17, 2019 at 11:52 AM David Lord wrote: > There is not, but you're welcome to use this list or our discord server if > you have questions about using it with flask > > On Mon, Sep 16, 2019, 13:00 Ben Duncan wrote: > >> Anyone know if there is a wtforms user group ? >> >> Thanks ... >> >> *Ben Duncan* >> DBA / Chief Software Architect >> Mississippi State Supreme Court >> Electronic Filing Division >> _______________________________________________ >> Flask mailing list >> Flask at python.org >> https://mail.python.org/mailman/listinfo/flask >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From linux4ms at gmail.com Wed Sep 18 09:02:10 2019 From: linux4ms at gmail.com (Ben Duncan) Date: Wed, 18 Sep 2019 08:02:10 -0500 Subject: [Flask] Show Value after error Flask/Wtforms Message-ID: In Flask / Wtforms, if you fail the validation, how to show the values back on the web form ? Sample:
{{ form.email.label.text }}
{% if form.email.errors %}
    {% for error in form.email.errors %}
  • {{ error }}
  • {% endfor %}
{% endif %} with the class being defined: class ContactForm(FlaskForm): name = StringField("Name: ", validators=[DataRequired()]) email = StringField("Email: ", validators=[Email()]) If there was an error of any sort, I would like the form errors to be re-displayed... Thanks *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division -------------- next part -------------- An HTML attachment was scrubbed... URL: From ub at artfacts.net Wed Sep 18 11:18:04 2019 From: ub at artfacts.net (ulrich) Date: Wed, 18 Sep 2019 17:18:04 +0200 Subject: [Flask] Show Value after error Flask/Wtforms In-Reply-To: References: Message-ID: <82ed65f3-fa27-cf70-48ac-bcc5c548c644@artfacts.net> hey ben, in your example, just add a value="{{ form.email.data }}" to your . i am sure there is an example somewhere in either flask snippets or flask-wtform examples. hope that helps, ub On 9/18/19 3:02 PM, Ben Duncan wrote: > In Flask / Wtforms, if you fail the validation, how to > show the values back on the web form ? > Sample: > > ?
{{ form.email.label.text }}
> ? ? ? ? ? ?????????????? style='width: 350px;' > ?????????????? name='email' > ?????????????? id='email' > ?????????????? type='text' > ?????????????? size='30' > ? ? ? ? ? > > ? ? ? ? {% if form.email.errors %} > ? ? ? ? ?
    > ? ? ? ? ? {% for error in form.email.errors %} > ? ? ? ? ? ?
  • {{ error }}
  • > ? ? ? ? {% endfor %} > ? ? ? ?
> ? ? ? ? {% endif %} > > with the class being defined: > class ContactForm(FlaskForm): > ? ? ? name = StringField("Name: ", validators=[DataRequired()]) > ? ? ? email = StringField("Email: ", validators=[Email()]) > > If there was an error of any sort, I would like the form errors to be > re-displayed... > > Thanks > > *Ben Duncan* > DBA / Chief Software Architect > Mississippi State Supreme Court > Electronic Filing Division > > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask -------------- next part -------------- An HTML attachment was scrubbed... URL: From linux4ms at gmail.com Thu Sep 19 11:11:05 2019 From: linux4ms at gmail.com (Ben Duncan) Date: Thu, 19 Sep 2019 10:11:05 -0500 Subject: [Flask] Flask / Wtforms Jinja Message-ID: In using wtforms and rendering with jinja is there a way to test in the template for a render_kw dictionary item? example: class ContactForm(FlaskForm): name = StringField("Name: " ,render_kw={ 'style': 'width: 350px; size:30', 'required': ''}) email = StringField("Email: ", validators=[Email()]) I would like to do something like this in the *template*: {% if form.name.render_kw("required") %} THIS FIELD IS REQUIRED {% endif %} As usually thanks ... *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division -------------- next part -------------- An HTML attachment was scrubbed... URL: From linux4ms at gmail.com Tue Sep 24 11:14:50 2019 From: linux4ms at gmail.com (Ben Duncan) Date: Tue, 24 Sep 2019 10:14:50 -0500 Subject: [Flask] Issues with Flash_session - Cannot add dict item .. Message-ID: Ok, am i missing something ? View: from flask import Flask, render_template, request, redirect, url_for, flash, make_response, escape, g from flask_session import Session from flask_sqlalchemy import SQLAlchemy from flask import session ..... app = Flask(__name__) print 'APP is : ', app csrf = CSRFProtect(app) session = Session() session.init_app(app) When I try to do something like this: session['modified'] = False I get : - e "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/flask/app.py", line *1935*, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) - File "/data/flask/applications/myproject/wtform.py", line *334*, in contact session['modified'] = False TypeError: 'Session' object does not support item assignment What Am I doing wrong .... ? *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergely at polonkai.eu Tue Sep 24 14:11:53 2019 From: gergely at polonkai.eu (Gergely Polonkai) Date: Tue, 24 Sep 2019 20:11:53 +0200 Subject: [Flask] Issues with Flash_session - Cannot add dict item .. In-Reply-To: References: Message-ID: My first thought, without actual code to look at, is that you import session from flask globally, but you also create a session variable somewhere which is an instance of flask_session.Session. Can this be your culprit? Or are you positive that the session variable you use is the same as the one you create? Best, Gergely On Tue, 24 Sep 2019, 17:15 Ben Duncan, wrote: > Ok, am i missing something ? > > View: > > from flask import Flask, render_template, request, redirect, url_for, > flash, make_response, escape, g > from flask_session import Session > from flask_sqlalchemy import SQLAlchemy > from flask import session > ..... > > app = Flask(__name__) > print 'APP is : ', app > csrf = CSRFProtect(app) > > session = Session() > session.init_app(app) > > When I try to do something like this: > > session['modified'] = False > > I get : > > - e > "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/flask/app.py", > line *1935*, in dispatch_request > > return self.view_functions[rule.endpoint](**req.view_args) > > - File "/data/flask/applications/myproject/wtform.py", line *334*, in > contact > > session['modified'] = False > > > TypeError: 'Session' object does not support item assignment > > What Am I doing wrong .... ? > > > *Ben Duncan* > DBA / Chief Software Architect > Mississippi State Supreme Court > Electronic Filing Division > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask > -------------- next part -------------- An HTML attachment was scrubbed... URL: From linux4ms at gmail.com Wed Sep 25 07:55:06 2019 From: linux4ms at gmail.com (Ben Duncan) Date: Wed, 25 Sep 2019 06:55:06 -0500 Subject: [Flask] Issues with Flash_session - Cannot add dict item .. In-Reply-To: References: Message-ID: Doing a dir on the Session defined in flask-session shows everything loaded. I'm not sure, but I did this in the view after all the session stuff: session{'status': 'GOOD'} And another dir after this show the original stuff in there with a bunch of new classes added. Could be that a user dictionary isn't established unless you initiate it ... I'd send the code samples, but alas OUR IT department has screwed up my local connection to our VM's.... sigh ... *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division On Tue, Sep 24, 2019 at 1:12 PM Gergely Polonkai wrote: > My first thought, without actual code to look at, is that you import > session from flask globally, but you also create a session variable > somewhere which is an instance of flask_session.Session. > > Can this be your culprit? Or are you positive that the session variable > you use is the same as the one you create? > > Best, > Gergely > > On Tue, 24 Sep 2019, 17:15 Ben Duncan, wrote: > >> Ok, am i missing something ? >> >> View: >> >> from flask import Flask, render_template, request, redirect, url_for, >> flash, make_response, escape, g >> from flask_session import Session >> from flask_sqlalchemy import SQLAlchemy >> from flask import session >> ..... >> >> app = Flask(__name__) >> print 'APP is : ', app >> csrf = CSRFProtect(app) >> >> session = Session() >> session.init_app(app) >> >> When I try to do something like this: >> >> session['modified'] = False >> >> I get : >> >> - e >> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/flask/app.py", >> line *1935*, in dispatch_request >> >> return self.view_functions[rule.endpoint](**req.view_args) >> >> - File "/data/flask/applications/myproject/wtform.py", line *334*, in >> contact >> >> session['modified'] = False >> >> >> TypeError: 'Session' object does not support item assignment >> >> What Am I doing wrong .... ? >> >> >> *Ben Duncan* >> DBA / Chief Software Architect >> Mississippi State Supreme Court >> Electronic Filing Division >> _______________________________________________ >> Flask mailing list >> Flask at python.org >> https://mail.python.org/mailman/listinfo/flask >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ziirish at ziirish.info Wed Sep 25 08:51:16 2019 From: ziirish at ziirish.info (Ziirish) Date: Wed, 25 Sep 2019 14:51:16 +0200 Subject: [Flask] Issues with Flash_session - Cannot add dict item .. In-Reply-To: References: Message-ID: <20190925125115.yoai3uge6ukksc4e@mail.ziirish.info> Here is your problem: from flask import session session = Session() The flask session object is not a Flask-Session Session object. What you want instead is: sess = Session() sess.init_app(app) Then you can do: session['modified'] = False # here session is the Flask's session object * On Wednesday, September 25, 2019 at 06:55 AM -0500, Ben Duncan wrote: > Doing a dir on the Session defined in flask-session shows everything loaded. > I'm not sure, but I did this in the view after all the session stuff: > > session{'status': 'GOOD'} > > And another dir after this show the original stuff in there with a bunch of > new classes added. > Could be that a user dictionary isn't established unless you initiate it ... > > I'd send the code samples, but alas OUR IT department has screwed up my > local connection to our VM's.... sigh ... > > *Ben Duncan* > DBA / Chief Software Architect > Mississippi State Supreme Court > Electronic Filing Division > > > On Tue, Sep 24, 2019 at 1:12 PM Gergely Polonkai > wrote: > > > My first thought, without actual code to look at, is that you import > > session from flask globally, but you also create a session variable > > somewhere which is an instance of flask_session.Session. > > > > Can this be your culprit? Or are you positive that the session variable > > you use is the same as the one you create? > > > > Best, > > Gergely > > > > On Tue, 24 Sep 2019, 17:15 Ben Duncan, wrote: > > > >> Ok, am i missing something ? > >> > >> View: > >> > >> from flask import Flask, render_template, request, redirect, url_for, > >> flash, make_response, escape, g > >> from flask_session import Session > >> from flask_sqlalchemy import SQLAlchemy > >> from flask import session > >> ..... > >> > >> app = Flask(__name__) > >> print 'APP is : ', app > >> csrf = CSRFProtect(app) > >> > >> session = Session() > >> session.init_app(app) > >> > >> When I try to do something like this: > >> > >> session['modified'] = False > >> > >> I get : > >> > >> - e > >> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/flask/app.py", > >> line *1935*, in dispatch_request > >> > >> return self.view_functions[rule.endpoint](**req.view_args) > >> > >> - File "/data/flask/applications/myproject/wtform.py", line *334*, in > >> contact > >> > >> session['modified'] = False > >> > >> > >> TypeError: 'Session' object does not support item assignment > >> > >> What Am I doing wrong .... ? > >> > >> > >> *Ben Duncan* > >> DBA / Chief Software Architect > >> Mississippi State Supreme Court > >> Electronic Filing Division From linux4ms at gmail.com Wed Sep 25 10:02:04 2019 From: linux4ms at gmail.com (Ben Duncan) Date: Wed, 25 Sep 2019 09:02:04 -0500 Subject: [Flask] Issues with Flash_session - Cannot add dict item .. In-Reply-To: <20190925125115.yoai3uge6ukksc4e@mail.ziirish.info> References: <20190925125115.yoai3uge6ukksc4e@mail.ziirish.info> Message-ID: Thanks for all the help ... Here is the code session = Session() print "Session type is --------", type(session) session.init_app(app) print "Session init type is --------", type(session) print "Dir of session is:", dir(session) session = {'modified': False } As noted, from my earlier post, it looks like a dictionary needs to be initialized with a dictionary. Once I did this, all is well in never-never land Local IT even fixed my borken desktop ... ? *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division On Wed, Sep 25, 2019 at 7:51 AM Ziirish wrote: > Here is your problem: > > from flask import session > session = Session() > > The flask session object is not a Flask-Session Session object. > > What you want instead is: > > > sess = Session() > sess.init_app(app) > > Then you can do: > > session['modified'] = False # here session is the Flask's session object > > > * On Wednesday, September 25, 2019 at 06:55 AM -0500, Ben Duncan < > linux4ms at gmail.com> wrote: > > Doing a dir on the Session defined in flask-session shows everything > loaded. > > I'm not sure, but I did this in the view after all the session stuff: > > > > session{'status': 'GOOD'} > > > > And another dir after this show the original stuff in there with a bunch > of > > new classes added. > > Could be that a user dictionary isn't established unless you initiate it > ... > > > > I'd send the code samples, but alas OUR IT department has screwed up my > > local connection to our VM's.... sigh ... > > > > *Ben Duncan* > > DBA / Chief Software Architect > > Mississippi State Supreme Court > > Electronic Filing Division > > > > > > On Tue, Sep 24, 2019 at 1:12 PM Gergely Polonkai > > wrote: > > > > > My first thought, without actual code to look at, is that you import > > > session from flask globally, but you also create a session variable > > > somewhere which is an instance of flask_session.Session. > > > > > > Can this be your culprit? Or are you positive that the session variable > > > you use is the same as the one you create? > > > > > > Best, > > > Gergely > > > > > > On Tue, 24 Sep 2019, 17:15 Ben Duncan, wrote: > > > > > >> Ok, am i missing something ? > > >> > > >> View: > > >> > > >> from flask import Flask, render_template, request, redirect, url_for, > > >> flash, make_response, escape, g > > >> from flask_session import Session > > >> from flask_sqlalchemy import SQLAlchemy > > >> from flask import session > > >> ..... > > >> > > >> app = Flask(__name__) > > >> print 'APP is : ', app > > >> csrf = CSRFProtect(app) > > >> > > >> session = Session() > > >> session.init_app(app) > > >> > > >> When I try to do something like this: > > >> > > >> session['modified'] = False > > >> > > >> I get : > > >> > > >> - e > > >> > "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/flask/app.py", > > >> line *1935*, in dispatch_request > > >> > > >> return self.view_functions[rule.endpoint](**req.view_args) > > >> > > >> - File "/data/flask/applications/myproject/wtform.py", line *334*, > in > > >> contact > > >> > > >> session['modified'] = False > > >> > > >> > > >> TypeError: 'Session' object does not support item assignment > > >> > > >> What Am I doing wrong .... ? > > >> > > >> > > >> *Ben Duncan* > > >> DBA / Chief Software Architect > > >> Mississippi State Supreme Court > > >> Electronic Filing Division > -------------- next part -------------- An HTML attachment was scrubbed... URL: From linux4ms at gmail.com Wed Sep 25 15:02:04 2019 From: linux4ms at gmail.com (Ben Duncan) Date: Wed, 25 Sep 2019 14:02:04 -0500 Subject: [Flask] Advice on best way : Message-ID: Ok, have all my session, wtf_forms, libraries all sorted as well as some nice macros for the templates, now seeking advice to build this whole application. It is basically a full fledged Accounting system (AR / AP / GL / OE /IV / PR / PO ) fronted by a some very specific Court front ends (fees. fines, restitution ) for the Criminal / Civil side and then some stuff latter to deal with the Chancery Courts. It's going to be quite large, probably with a few hundred web pages , with interfacing with all the systems (Think ERP) with drill downs all the way back to the originating document. Any advice on how to structure, what next I need to read, design considerations or any other adice this group can give me, would be appreciated Thanks ... *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergely at polonkai.eu Thu Sep 26 00:03:05 2019 From: gergely at polonkai.eu (Gergely Polonkai) Date: Thu, 26 Sep 2019 06:03:05 +0200 Subject: [Flask] Advice on best way : In-Reply-To: References: Message-ID: What you outlined here /is/ a full fledged ERP system. Without the actual requirement list it?s somewhat impossible to devise anything. You should find a trustworthy software architect to do it. And that ain?t cheap, especially given that this is for some government thingie (most people will double their price for govts). So if you need true advice here, you?d better share the full requirements list which might even be illegal depending on your contract. If you don?t have that, i think you shouldn?t start the project. Best, Gergely On Wed, 25 Sep 2019, 21:02 Ben Duncan, wrote: > Ok, have all my session, wtf_forms, libraries all sorted as well as some > nice macros for the templates, now seeking advice to build this whole > application. > > It is basically a full fledged Accounting system (AR / AP / GL / OE /IV / > PR / PO ) fronted by a some very specific Court front ends (fees. fines, > restitution ) for the Criminal / Civil side and then some stuff latter to > deal with the Chancery Courts. > > It's going to be quite large, probably with a few hundred web pages , with > interfacing with all the systems (Think ERP) with drill downs all the way > back to the originating document. > > Any advice on how to structure, what next I need to read, design > considerations or any other adice this group can give me, would be > appreciated > > Thanks ... > > > *Ben Duncan* > DBA / Chief Software Architect > Mississippi State Supreme Court > Electronic Filing Division > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tamasiaina at gmail.com Thu Sep 26 05:47:22 2019 From: tamasiaina at gmail.com (Jonathan Chen) Date: Thu, 26 Sep 2019 03:47:22 -0600 Subject: [Flask] Advice on best way : In-Reply-To: References: Message-ID: Hey Ben, I have dealt with implementing an ERP System in the past (Oracle E-Business Suite). There are some things though that depend on the scope of the project. I'll be honest though depending on how large the project is and how many people will be interacting with it, it could take a long time to develop this system. If you have to deal with legacy data as well it can add more time to it depending on how clean the data is. The key thing though is that there should be good documentation on how to use and develop the system. Are you a company building the software for the Courts or do you work for the Chancery Courts? I'm free to talk on a private basis as well. ~Jonathan C. On Wed, Sep 25, 2019 at 10:03 PM Gergely Polonkai wrote: > What you outlined here /is/ a full fledged ERP system. Without the actual > requirement list it?s somewhat impossible to devise anything. You should > find a trustworthy software architect to do it. And that ain?t cheap, > especially given that this is for some government thingie (most people will > double their price for govts). > > So if you need true advice here, you?d better share the full requirements > list which might even be illegal depending on your contract. If you don?t > have that, i think you shouldn?t start the project. > > Best, > Gergely > > On Wed, 25 Sep 2019, 21:02 Ben Duncan, wrote: > >> Ok, have all my session, wtf_forms, libraries all sorted as well as some >> nice macros for the templates, now seeking advice to build this whole >> application. >> >> It is basically a full fledged Accounting system (AR / AP / GL / OE /IV / >> PR / PO ) fronted by a some very specific Court front ends (fees. fines, >> restitution ) for the Criminal / Civil side and then some stuff latter to >> deal with the Chancery Courts. >> >> It's going to be quite large, probably with a few hundred web pages , >> with interfacing with all the systems (Think ERP) with drill downs all the >> way back to the originating document. >> >> Any advice on how to structure, what next I need to read, design >> considerations or any other adice this group can give me, would be >> appreciated >> >> Thanks ... >> >> >> *Ben Duncan* >> DBA / Chief Software Architect >> Mississippi State Supreme Court >> Electronic Filing Division >> _______________________________________________ >> Flask mailing list >> Flask at python.org >> https://mail.python.org/mailman/listinfo/flask >> > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask > -------------- next part -------------- An HTML attachment was scrubbed... URL: From linux4ms at gmail.com Thu Sep 26 07:16:12 2019 From: linux4ms at gmail.com (Ben Duncan) Date: Thu, 26 Sep 2019 06:16:12 -0500 Subject: [Flask] Advice on best way : In-Reply-To: References: Message-ID: I'm doing it as am employee of the court system. I've done this things in the past (Over 30 years experience), so not a biggie. I've got as many years source code of 4Gl systems, COBOL systems, client / server systems in my stash, all of them GASPI / GAAP compliant, so, I've got the road maps. Already, I've generated the Postgres DB, by writing python programs that scrapped a lot of schema / file layouts and taken the best of all worlds. It's all "multi company' (multiple location). Most of the stuff we are doing will probably go back up to the GIT repos for others to use. LOL, I can pretty much tell you how posting / and distributions to GL / Fund / Org need to be done by memory alone, so figuring out the business logic is easy. It's NOW figuring out that (coming froma client / server , 4GL environment) you are MAINLY programming the BROWSER, and not so much actual user interface, so I'm learning a lot. Yeah, I know , It's a BIG task, but at the risk of sounding egotistical , it really isn't that big of a deal ... *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division On Thu, Sep 26, 2019 at 4:47 AM Jonathan Chen wrote: > Hey Ben, > > I have dealt with implementing an ERP System in the past (Oracle > E-Business Suite). There are some things though that depend on the scope of > the project. I'll be honest though depending on how large the project is > and how many people will be interacting with it, it could take a long time > to develop this system. If you have to deal with legacy data as well it can > add more time to it depending on how clean the data is. The key thing > though is that there should be good documentation on how to use and develop > the system. Are you a company building the software for the Courts or do > you work for the Chancery Courts? I'm free to talk on a private basis as > well. > > ~Jonathan C. > > > On Wed, Sep 25, 2019 at 10:03 PM Gergely Polonkai > wrote: > >> What you outlined here /is/ a full fledged ERP system. Without the actual >> requirement list it?s somewhat impossible to devise anything. You should >> find a trustworthy software architect to do it. And that ain?t cheap, >> especially given that this is for some government thingie (most people will >> double their price for govts). >> >> So if you need true advice here, you?d better share the full requirements >> list which might even be illegal depending on your contract. If you don?t >> have that, i think you shouldn?t start the project. >> >> Best, >> Gergely >> >> On Wed, 25 Sep 2019, 21:02 Ben Duncan, wrote: >> >>> Ok, have all my session, wtf_forms, libraries all sorted as well as some >>> nice macros for the templates, now seeking advice to build this whole >>> application. >>> >>> It is basically a full fledged Accounting system (AR / AP / GL / OE /IV >>> / PR / PO ) fronted by a some very specific Court front ends (fees. fines, >>> restitution ) for the Criminal / Civil side and then some stuff latter to >>> deal with the Chancery Courts. >>> >>> It's going to be quite large, probably with a few hundred web pages , >>> with interfacing with all the systems (Think ERP) with drill downs all the >>> way back to the originating document. >>> >>> Any advice on how to structure, what next I need to read, design >>> considerations or any other adice this group can give me, would be >>> appreciated >>> >>> Thanks ... >>> >>> >>> *Ben Duncan* >>> DBA / Chief Software Architect >>> Mississippi State Supreme Court >>> Electronic Filing Division >>> _______________________________________________ >>> Flask mailing list >>> Flask at python.org >>> https://mail.python.org/mailman/listinfo/flask >>> >> _______________________________________________ >> Flask mailing list >> Flask at python.org >> https://mail.python.org/mailman/listinfo/flask >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From paradox2005 at gmail.com Thu Sep 26 08:04:04 2019 From: paradox2005 at gmail.com (Adil Hasan) Date: Thu, 26 Sep 2019 13:04:04 +0100 Subject: [Flask] Advice on best way : In-Reply-To: References: Message-ID: <20190926120402.GJ3670@parsnip> Hello Ben, one thing I would worry about is having a lot of pages served by one app. Is it possible to separate them? If you need to update some pages on one part then you would only need to rebuild that app. Perhaps it could also help with resiliance and maybe performance? My money's on you producing something very good, adil On Thu, Sep 26, 2019 at 06:16:12AM -0500, Ben Duncan wrote: > I'm doing it as am employee of the court system. > > I've done this things in the past (Over 30 years experience), so not a > biggie. > > I've got as many years source code of 4Gl systems, COBOL systems, client / > server systems in my stash, all of them GASPI / GAAP compliant, so, I've got > the road maps. > > Already, I've generated the Postgres DB, by writing python programs that > scrapped a lot of schema / file layouts and taken the best of all worlds. > It's all "multi company' (multiple location). Most of the stuff we are > doing will probably go back up to the GIT repos for others to use. > > LOL, I can pretty much tell you how posting / and distributions to GL / > Fund / Org need to be done by memory alone, so figuring out the > business logic is easy. > > It's NOW figuring out that (coming froma client / server , 4GL environment) > you are MAINLY programming the BROWSER, and not so much > actual user interface, so I'm learning a lot. > > Yeah, I know , It's a BIG task, but at the risk of sounding egotistical , > it really isn't that big of a deal ... > > *Ben Duncan* > DBA / Chief Software Architect > Mississippi State Supreme Court > Electronic Filing Division > > > On Thu, Sep 26, 2019 at 4:47 AM Jonathan Chen wrote: > > > Hey Ben, > > > > I have dealt with implementing an ERP System in the past (Oracle > > E-Business Suite). There are some things though that depend on the scope of > > the project. I'll be honest though depending on how large the project is > > and how many people will be interacting with it, it could take a long time > > to develop this system. If you have to deal with legacy data as well it can > > add more time to it depending on how clean the data is. The key thing > > though is that there should be good documentation on how to use and develop > > the system. Are you a company building the software for the Courts or do > > you work for the Chancery Courts? I'm free to talk on a private basis as > > well. > > > > ~Jonathan C. > > > > > > On Wed, Sep 25, 2019 at 10:03 PM Gergely Polonkai > > wrote: > > > >> What you outlined here /is/ a full fledged ERP system. Without the actual > >> requirement list it?s somewhat impossible to devise anything. You should > >> find a trustworthy software architect to do it. And that ain?t cheap, > >> especially given that this is for some government thingie (most people will > >> double their price for govts). > >> > >> So if you need true advice here, you?d better share the full requirements > >> list which might even be illegal depending on your contract. If you don?t > >> have that, i think you shouldn?t start the project. > >> > >> Best, > >> Gergely > >> > >> On Wed, 25 Sep 2019, 21:02 Ben Duncan, wrote: > >> > >>> Ok, have all my session, wtf_forms, libraries all sorted as well as some > >>> nice macros for the templates, now seeking advice to build this whole > >>> application. > >>> > >>> It is basically a full fledged Accounting system (AR / AP / GL / OE /IV > >>> / PR / PO ) fronted by a some very specific Court front ends (fees. fines, > >>> restitution ) for the Criminal / Civil side and then some stuff latter to > >>> deal with the Chancery Courts. > >>> > >>> It's going to be quite large, probably with a few hundred web pages , > >>> with interfacing with all the systems (Think ERP) with drill downs all the > >>> way back to the originating document. > >>> > >>> Any advice on how to structure, what next I need to read, design > >>> considerations or any other adice this group can give me, would be > >>> appreciated > >>> > >>> Thanks ... > >>> > >>> > >>> *Ben Duncan* > >>> DBA / Chief Software Architect > >>> Mississippi State Supreme Court > >>> Electronic Filing Division > >>> _______________________________________________ > >>> Flask mailing list > >>> Flask at python.org > >>> https://mail.python.org/mailman/listinfo/flask > >>> > >> _______________________________________________ > >> Flask mailing list > >> Flask at python.org > >> https://mail.python.org/mailman/listinfo/flask > >> > > > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask From linux4ms at gmail.com Thu Sep 26 08:26:46 2019 From: linux4ms at gmail.com (Ben Duncan) Date: Thu, 26 Sep 2019 07:26:46 -0500 Subject: [Flask] Advice on best way : In-Reply-To: <20190926120402.GJ3670@parsnip> References: <20190926120402.GJ3670@parsnip> Message-ID: That was my Idea, The Back Office for the Accounting stuff is for all the regulators and auditors. I was looking at BluePrints and other ideas .. *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division On Thu, Sep 26, 2019 at 7:04 AM Adil Hasan wrote: > Hello Ben, > > one thing I would worry about is having a lot of pages served by one > app. Is it possible to separate them? If you need to update some pages > on one part then you would only need to rebuild that app. Perhaps it > could also help with resiliance and maybe performance? > > My money's on you producing something very good, > adil > > On Thu, Sep 26, 2019 at 06:16:12AM -0500, Ben Duncan wrote: > > I'm doing it as am employee of the court system. > > > > I've done this things in the past (Over 30 years experience), so not a > > biggie. > > > > I've got as many years source code of 4Gl systems, COBOL systems, client > / > > server systems in my stash, all of them GASPI / GAAP compliant, so, I've > got > > the road maps. > > > > Already, I've generated the Postgres DB, by writing python programs that > > scrapped a lot of schema / file layouts and taken the best of all worlds. > > It's all "multi company' (multiple location). Most of the stuff we are > > doing will probably go back up to the GIT repos for others to use. > > > > LOL, I can pretty much tell you how posting / and distributions to GL / > > Fund / Org need to be done by memory alone, so figuring out the > > business logic is easy. > > > > It's NOW figuring out that (coming froma client / server , 4GL > environment) > > you are MAINLY programming the BROWSER, and not so much > > actual user interface, so I'm learning a lot. > > > > Yeah, I know , It's a BIG task, but at the risk of sounding egotistical , > > it really isn't that big of a deal ... > > > > *Ben Duncan* > > DBA / Chief Software Architect > > Mississippi State Supreme Court > > Electronic Filing Division > > > > > > On Thu, Sep 26, 2019 at 4:47 AM Jonathan Chen > wrote: > > > > > Hey Ben, > > > > > > I have dealt with implementing an ERP System in the past (Oracle > > > E-Business Suite). There are some things though that depend on the > scope of > > > the project. I'll be honest though depending on how large the project > is > > > and how many people will be interacting with it, it could take a long > time > > > to develop this system. If you have to deal with legacy data as well > it can > > > add more time to it depending on how clean the data is. The key thing > > > though is that there should be good documentation on how to use and > develop > > > the system. Are you a company building the software for the Courts or > do > > > you work for the Chancery Courts? I'm free to talk on a private basis > as > > > well. > > > > > > ~Jonathan C. > > > > > > > > > On Wed, Sep 25, 2019 at 10:03 PM Gergely Polonkai > > > > wrote: > > > > > >> What you outlined here /is/ a full fledged ERP system. Without the > actual > > >> requirement list it?s somewhat impossible to devise anything. You > should > > >> find a trustworthy software architect to do it. And that ain?t cheap, > > >> especially given that this is for some government thingie (most > people will > > >> double their price for govts). > > >> > > >> So if you need true advice here, you?d better share the full > requirements > > >> list which might even be illegal depending on your contract. If you > don?t > > >> have that, i think you shouldn?t start the project. > > >> > > >> Best, > > >> Gergely > > >> > > >> On Wed, 25 Sep 2019, 21:02 Ben Duncan, wrote: > > >> > > >>> Ok, have all my session, wtf_forms, libraries all sorted as well as > some > > >>> nice macros for the templates, now seeking advice to build this whole > > >>> application. > > >>> > > >>> It is basically a full fledged Accounting system (AR / AP / GL / OE > /IV > > >>> / PR / PO ) fronted by a some very specific Court front ends (fees. > fines, > > >>> restitution ) for the Criminal / Civil side and then some stuff > latter to > > >>> deal with the Chancery Courts. > > >>> > > >>> It's going to be quite large, probably with a few hundred web pages , > > >>> with interfacing with all the systems (Think ERP) with drill downs > all the > > >>> way back to the originating document. > > >>> > > >>> Any advice on how to structure, what next I need to read, design > > >>> considerations or any other adice this group can give me, would be > > >>> appreciated > > >>> > > >>> Thanks ... > > >>> > > >>> > > >>> *Ben Duncan* > > >>> DBA / Chief Software Architect > > >>> Mississippi State Supreme Court > > >>> Electronic Filing Division > > >>> _______________________________________________ > > >>> Flask mailing list > > >>> Flask at python.org > > >>> https://mail.python.org/mailman/listinfo/flask > > >>> > > >> _______________________________________________ > > >> Flask mailing list > > >> Flask at python.org > > >> https://mail.python.org/mailman/listinfo/flask > > >> > > > > > > _______________________________________________ > > Flask mailing list > > Flask at python.org > > https://mail.python.org/mailman/listinfo/flask > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From peterhickman386 at googlemail.com Thu Sep 26 09:06:00 2019 From: peterhickman386 at googlemail.com (Peter Hickman) Date: Thu, 26 Sep 2019 14:06:00 +0100 Subject: [Flask] Advice on best way : In-Reply-To: References: <20190926120402.GJ3670@parsnip> Message-ID: On Thu, 26 Sep 2019 at 13:29, Ben Duncan wrote: > That was my Idea, The Back Office for the Accounting stuff is for all the > regulators and auditors. > I was looking at BluePrints and other ideas .. > > *Ben Duncan* > DBA / Chief Software Architect > Mississippi State Supreme Court > Electronic Filing Division > > > On Thu, Sep 26, 2019 at 7:04 AM Adil Hasan wrote: > >> Hello Ben, >> >> one thing I would worry about is having a lot of pages served by one >> app. Is it possible to separate them? If you need to update some pages >> on one part then you would only need to rebuild that app. Perhaps it >> could also help with resiliance and maybe performance? >> > This might be a little clunky but we use this on a couple of our sites. Our webserver is Nginx but this should be possible with other but we have it pass off requests for some path, /api for example, to another upstream, a host and port. So we have multiple apps serving different parts of the site. This means that we can take down the upstream that serves the web front end without touching the /api feed. If necessary these can live on different hosts allowing you to upgrade the horsepower behind a given path simply by changing the host of the upstream and reloading the nginx configuration -------------- next part -------------- An HTML attachment was scrubbed... URL: From tamasiaina at gmail.com Thu Sep 26 09:37:18 2019 From: tamasiaina at gmail.com (Jonathan Chen) Date: Thu, 26 Sep 2019 07:37:18 -0600 Subject: [Flask] Advice on best way : In-Reply-To: References: <20190926120402.GJ3670@parsnip> Message-ID: Okay, I just wanted to make sure that you understood its a big task. I hope you didn't take offense to what I said. Yeah, it's going to take a lot of pounding on the keyboard, and business requirements and logic is most of the battle. If you want to look into "trendy" cool things right now, which I actually like to do. You can build the frontend via React or Angular, and have flask serve all the API's. I would separate all the different API's into blueprints. At first, I would just bundle all the blueprints together for the sake of actually getting things done. Afterwards, You can break the API's up into its own services really easily. ~Jonathan C. On Thu, Sep 26, 2019 at 7:06 AM Peter Hickman via Flask wrote: > On Thu, 26 Sep 2019 at 13:29, Ben Duncan wrote: > >> That was my Idea, The Back Office for the Accounting stuff is for all the >> regulators and auditors. >> I was looking at BluePrints and other ideas .. >> >> *Ben Duncan* >> DBA / Chief Software Architect >> Mississippi State Supreme Court >> Electronic Filing Division >> >> >> On Thu, Sep 26, 2019 at 7:04 AM Adil Hasan wrote: >> >>> Hello Ben, >>> >>> one thing I would worry about is having a lot of pages served by one >>> app. Is it possible to separate them? If you need to update some pages >>> on one part then you would only need to rebuild that app. Perhaps it >>> could also help with resiliance and maybe performance? >>> >> > This might be a little clunky but we use this on a couple of our sites. > Our webserver is Nginx but this should be possible with other but we have > it pass off requests for some path, /api for example, to another upstream, > a host and port. So we have multiple apps serving different parts of the > site. This means that we can take down the upstream that serves the web > front end without touching the /api feed. If necessary these can live on > different hosts allowing you to upgrade the horsepower behind a given path > simply by changing the host of the upstream and reloading the nginx > configuration > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask > -------------- next part -------------- An HTML attachment was scrubbed... URL: From linux4ms at gmail.com Thu Sep 26 10:19:20 2019 From: linux4ms at gmail.com (Ben Duncan) Date: Thu, 26 Sep 2019 09:19:20 -0500 Subject: [Flask] Advice on best way : In-Reply-To: References: <20190926120402.GJ3670@parsnip> Message-ID: I see your point Jonathan, but as nice as it would be to play with those things, I'm already heads in learning all this new fangled Web Programming ? Business logic I got , and If need to be I can logic scrape those using python. Most of the time, ERP / Accounting applications are pretty boring - no pretty, pretty pictures, nekid pictures, panoramic vista views, or music in them , just boring boring static type stuff. Dynamic stuff comes pretty much during reporting or report / posting , but even that is fairly structured. *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division On Thu, Sep 26, 2019 at 8:37 AM Jonathan Chen wrote: > Okay, I just wanted to make sure that you understood its a big task. I > hope you didn't take offense to what I said. Yeah, it's going to take a lot > of pounding on the keyboard, and business requirements and logic is most of > the battle. > > If you want to look into "trendy" cool things right now, which I actually > like to do. > > You can build the frontend via React or Angular, and have flask serve all > the API's. I would separate all the different API's into blueprints. At > first, I would just bundle all the blueprints together for the sake of > actually getting things done. Afterwards, You can break the API's up into > its own services really easily. > > ~Jonathan C. > > > On Thu, Sep 26, 2019 at 7:06 AM Peter Hickman via Flask > wrote: > >> On Thu, 26 Sep 2019 at 13:29, Ben Duncan wrote: >> >>> That was my Idea, The Back Office for the Accounting stuff is for all >>> the regulators and auditors. >>> I was looking at BluePrints and other ideas .. >>> >>> *Ben Duncan* >>> DBA / Chief Software Architect >>> Mississippi State Supreme Court >>> Electronic Filing Division >>> >>> >>> On Thu, Sep 26, 2019 at 7:04 AM Adil Hasan >>> wrote: >>> >>>> Hello Ben, >>>> >>>> one thing I would worry about is having a lot of pages served by one >>>> app. Is it possible to separate them? If you need to update some pages >>>> on one part then you would only need to rebuild that app. Perhaps it >>>> could also help with resiliance and maybe performance? >>>> >>> >> This might be a little clunky but we use this on a couple of our sites. >> Our webserver is Nginx but this should be possible with other but we have >> it pass off requests for some path, /api for example, to another upstream, >> a host and port. So we have multiple apps serving different parts of the >> site. This means that we can take down the upstream that serves the web >> front end without touching the /api feed. If necessary these can live on >> different hosts allowing you to upgrade the horsepower behind a given path >> simply by changing the host of the upstream and reloading the nginx >> configuration >> _______________________________________________ >> Flask mailing list >> Flask at python.org >> https://mail.python.org/mailman/listinfo/flask >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From linux4ms at gmail.com Mon Sep 30 09:31:02 2019 From: linux4ms at gmail.com (Ben Duncan) Date: Mon, 30 Sep 2019 08:31:02 -0500 Subject: [Flask] Data validation Message-ID: Ok, I got how to do data validation using wtforms, as well as preventing CSRF. Now, how is the procedure I need to do if the data fails SERVER validation? For example, it passes 'form.validate()" but testing within that 'if' reveals bad data. I want to keep the existing data in the form, but reject the form because some value was not correct, and set a error message and re display the form ... As always thanks. *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division -------------- next part -------------- An HTML attachment was scrubbed... URL: From linux4ms at gmail.com Mon Sep 30 15:55:24 2019 From: linux4ms at gmail.com (Ben Duncan) Date: Mon, 30 Sep 2019 14:55:24 -0500 Subject: [Flask] Data validation In-Reply-To: References: Message-ID: Never mind , found the answer on page 198 of the book "flask by Example" HOORAY ... Man, I LOVE flask !!!! *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division On Mon, Sep 30, 2019 at 8:31 AM Ben Duncan wrote: > Ok, I got how to do data validation using wtforms, as well as preventing > CSRF. > > Now, how is the procedure I need to do if the data fails SERVER validation? > > For example, it passes 'form.validate()" but testing within that 'if' > reveals bad data. I want to keep the existing data in the form, but reject > the form because > some value was not correct, and set a error message and re display the > form ... > > As always thanks. > > > *Ben Duncan* > DBA / Chief Software Architect > Mississippi State Supreme Court > Electronic Filing Division > -------------- next part -------------- An HTML attachment was scrubbed... URL: