remove unused files

This commit is contained in:
Andreas Zweili 2018-09-03 22:44:40 +02:00
parent 1dc4bfeb0f
commit 12e855b77a
2 changed files with 0 additions and 83 deletions

View File

@ -1,33 +0,0 @@
#!/usr/bin/python
import mysql.connector as mariadb
mariadb_connection = mariadb.connect(user='vagrant',
database='testdb')
cursor = mariadb_connection.cursor()
cursor.execute("""create table if not exists test (
id bigint auto_increment primary key,
username varchar(128),
first_name varchar(128),
middle_name varchar(128)),
last_name varchar(128)),
street_name varchar(128)),
city_name varchar(128)),
state_name varchar(128)),
country_name varchar(128)),
telephonenumber varchar(128)),
mobile_number varchar(128)),
email varchar(128)),
hobby varchar(128)),
gender varchar(128)),
salutation varchar(128)),
""")
cursor.execute("""INSERT INTO test (first_name,last_name) VALUES (%s,%s)""",
("first_name", "last_name"))
mariadb_connection.commit()
cursor.execute("select * from test")
data = cursor.fetchall()
for row in data:
print(row)

View File

@ -1,50 +0,0 @@
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = (
'mysql+mysqlconnector://vagrant@localhost/testdb')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
class Country(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), unique=True, nullable=False)
def __repr__(self):
return '<Country %r>' % self.name
class City(db.Model):
id = db.Column(db.Integer, primary_key=True)
zip_code = db.Column(db.Integer, unique=True, nullable=False)
name = db.Column(db.String(80), unique=True, nullable=False)
country_id = db.Column(db.Integer, db.ForeignKey('country.id'),
nullable=False)
country = db.relationship('City', backref=db.backref('countrys',
lazy=True))
def __repr__(self):
return '<City %r>' % self.name
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True, nullable=False)
email = db.Column(db.String(120), unique=True, nullable=False)
first_name = db.Column(db.String(120), nullable=False)
last_name = db.Column(db.String(120), nullable=False)
middle_name = db.Column(db.String(120), nullable=False)
street_name = db.Column(db.String(120), nullable=False)
telephonenumber = db.Column(db.String(120), nullable=False)
mobile_number = db.Column(db.String(120), nullable=False)
hobby = db.Column(db.String(120), nullable=False)
salutation = db.Column(db.String(120), nullable=False)
gender = db.Column(db.String(120), nullable=False)
city_id = db.Column(db.Integer, db.ForeignKey('city.id'), nullable=False)
city = db.relationship('City', backref=db.backref('users', lazy=True))
def __repr__(self):
return '<User %r>' % self.username