Skip to content

Instantly share code, notes, and snippets.

@fuzzy
Created January 21, 2014 06:38
Show Gist options
  • Save fuzzy/8535370 to your computer and use it in GitHub Desktop.
Save fuzzy/8535370 to your computer and use it in GitHub Desktop.
models
from cryptolizzard.db.peewee import *
db = MySQLDatabase('cryptolizzard', user='clizzard', passwd='<pass>', host='192.168.0.2')
db.connect()
class BaseModel(Model):
class Meta:
database = db
# Operational models
class Menu(BaseModel):
link = CharField()
text = CharField()
# Metrics related models
class Currency(BaseModel):
symbol = CharField()
class Exchange(BaseModel):
name = CharField()
class ExchangeEntry(BaseModel):
currency = ForeignKeyField(Currency)
exchange = ForeignKeyField(Exchange)
datetime = IntegerField()
ask = FloatField()
bid = FloatField()
last = FloatField()
volume_btc = FloatField()
volume_total = FloatField()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment