Skip to content

Commit

Permalink
Changement de nom de l'exemple.
Browse files Browse the repository at this point in the history
  • Loading branch information
c4software committed Sep 21, 2011
1 parent 5c27830 commit f1c8628
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from sqlalchemy import Column, Integer, Text
from sqlalchemy import Column, Integer, Text, String
from database import Base

class demo(Base):
__tablename__ = 'champ'
__tablename__ = 'demo'
id = Column(Integer, primary_key=True)
number = Column(String(50))
value = Column(Text)

def __init__(self, value=''):
def __init__(self, number='', value=''):
self.value = value
self.number = number

def __repr__(self):
return '<demo %r>' % (self.value)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask import Flask
from flask import Flask, session

# Import de la session pour les requete SQL.
from database import db_session
Expand All @@ -13,6 +13,11 @@
def hello():
return "Hello World!"

# Fonction appele a chaque appel HTTP
@app.before_request
def before_request():
print "Appel HTTP"

# Permet de fermer la connexion mySQL.
@app.teardown_request
def shutdown_session(exception):
Expand Down

0 comments on commit f1c8628

Please sign in to comment.