-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.py
More file actions
27 lines (22 loc) · 751 Bytes
/
model.py
File metadata and controls
27 lines (22 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#coding=utf-8
from config import *
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = SQLALCHEMY_DATABASE_URI
app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True
db = SQLAlchemy(app)
class Members(db.Model):
name = db.Column(db.String(80), primary_key=True)
email = db.Column(db.String(80), unique=True)
qq = db.Column(db.String(80), unique=True)
telephone = db.Column(db.String(80), unique=True)
ideas = db.Column(db.String(600), unique=False)
def __init__(self, name, email, qq, telephone, ideas):
self.name = name
self.email = email
self.qq = qq
self.telephone = telephone
self.ideas = ideas
def __repr__(self):
return "<Members %r>" % self.name