-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinfoGen.py
More file actions
31 lines (27 loc) · 992 Bytes
/
infoGen.py
File metadata and controls
31 lines (27 loc) · 992 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
27
28
29
30
31
from sqlalchemy import *
from sqlalchemy import create_engine, ForeignKey
from sqlalchemy import Column, Date, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, backref
engine = create_engine('sqlite:///users.db', echo=True)
Base = declarative_base()
########################################################################
class Info(Base):
""""""
__tablename__ = "info"
id = Column(Integer, primary_key=True)
username = Column(String)
name = Column(String)
topic = Column(String)
specifics = Column(String)
location = Column(Boolean)
#----------------------------------------------------------------------
def __init__(self, username, name, topic, specifics, location):
""""""
self.username = username
self.name = name
self.topic = topic
self.specifics = specifics
self.location = location
# create tables
Base.metadata.create_all(engine)