GithubHelp home page GithubHelp logo

balasubrahmanyamd-rt / json-to-flask-crud-for-your-python-flask-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rohit-chouhan/json-to-flask-crud

0.0 0.0 0.0 10 KB

Generate complete Insert & Update for your Python Flask Application in a minute

Home Page: https://rohit-chouhan.github.io/json-to-flask-crud/

JavaScript 49.25% HTML 50.75%

json-to-flask-crud-for-your-python-flask-app's Introduction

Json to Flask Code Generator

Generate complete Insert & Update for your Python Flask Application in a minute.

rohit-chouhan/json-to-flask-crud

Object Usage Example
init To define what you want to do, Insert or Update insert, update
def Method name - - -
methods Method request POST, GET
route Route prefix for access page - - -
table Table name of database where you want to make changes - - -
field In the field you have to give table's column name as key and html form name as value - - -
"field":{
  "table_column_name":"html_form_input_name"
}

Json Code

{
	"init": "insert",
	"def": "add_new_user",
	"methods": ["POST"],
	"route": "adduser",
	"table": "users",
	"field": {
		"name": "user_name",
		"email": "user_email",
		"city": "user_city"
	}
}

Generated Code

@app.route('/adduser', methods = ['POST'])  
def add_new_user():  
  name=request.form['user_name']
  email=request.form['user_email']
  city=request.form['user_city']
  
  cur = mysql.connection.cursor()
  cur.execute("INSERT INTO users (name,email,city) VALUES ('"+user_name+"','"+user_email+"','"+user_city+"')")
  mysql.connection.commit()
  cur.close()

json-to-flask-crud-for-your-python-flask-app's People

Contributors

rohit-chouhan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.