Created
October 24, 2014 12:44
-
-
Save DriesS/642ef8146ff3d685457a to your computer and use it in GitHub Desktop.
user.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import Column, DateTime, String, Integer, ForeignKey, func | |
from sqlalchemy.orm import relationship, backref | |
from sqlalchemy.ext.declarative import declarative_base | |
import os | |
import sys | |
Base = declarative_base() | |
from falcon_mvc.database import db_session | |
class User(Base): | |
__tablename__ = 'users' | |
id = Column(Integer, primary_key=True) | |
name = Column(String) | |
def __init__(self, data=False): | |
self.dataHandle = data | |
print 'model loaded' | |
print sys.path | |
def get(self, arg): | |
s = db_session | |
s.query(User).all() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment