python sqlalchemy insert

Solutions on MaxInterview for python sqlalchemy insert by the best coders in the world

showing results for - "python sqlalchemy insert"
Eline
07 Apr 2017
1>>> from sqlalchemy import Column, Integer, String
2>>> class User(Base):
3...     __tablename__ = 'users'
4...
5...     id = Column(Integer, primary_key=True)
6...     name = Column(String)
7...     fullname = Column(String)
8...     nickname = Column(String)
9...
10...     def __repr__(self):
11...        return "<User(name='%s', fullname='%s', nickname='%s')>" % (
12...                             self.name, self.fullname, self.nickname)