# Path: sms.py
# def sms(number, message):
# 	client = TwilioRestClient(account, token)
# 	if number[0] != '+':
# 		if number[0] == '1':
# 			number = '+' + number
# 		else:
# 			assert len(number) == 10
# 			number = '+1' + number
# 	client.sms.messages.create(to=number, from_=from_number, body=message)


import math, json, os, random
import sqlalchemy as sa
import hashlib
import markdown2
from datetime import datetime
from sqlalchemy.orm import relationship
from sqlalchemy.types import *
from sms import sms
from metamodel import *
		from handler import handler
		from handler import handler
		from handler import email
	if id == WOW:
		return 'WoW'
	elif id == SWTOR:
		return 'SW:TOR'

@Model
class GoldHistory(object):
	user_id = ForeignKey(Integer, 'User.id')
	date = DateTime
	amount = Integer
	balance = Integer
	dollars = Integer
	job_id = ForeignKey(Integer, 'Job.id', nullable=True)
	desc = Unicode

@Model
class Bid(object):
	job_id = ForeignKey(Integer, 'Job.id')
	char_id = ForeignKey(Integer, 'Character.id')
	amount = Integer
	date = DateTime
	accepted = Boolean

	def accept(self):
		with transact:
			self.update(accepted=True)
			self.job.update(accepted_date=datetime.now())

@Model
class Job(object):

# Path: sms.py
# def sms(number, message):
# 	client = TwilioRestClient(account, token)
# 	if number[0] != '+':
# 		if number[0] == '1':
# 			number = '+' + number
# 		else:
# 			assert len(number) == 10
# 			number = '+1' + number
# 	client.sms.messages.create(to=number, from_=from_number, body=message)


# Path: model.py
import math, json, os, random
import sqlalchemy as sa
import hashlib
import markdown2
from datetime import datetime
from sqlalchemy.orm import relationship
from sqlalchemy.types import *
from sms import sms
from metamodel import *
		from handler import handler
		from handler import handler
		from handler import email

	if id == WOW:
		return 'WoW'
	elif id == SWTOR:
		return 'SW:TOR'

@Model
class GoldHistory(object):
	user_id = ForeignKey(Integer, 'User.id')
	date = DateTime
	amount = Integer
	balance = Integer
	dollars = Integer
	job_id = ForeignKey(Integer, 'Job.id', nullable=True)
	desc = Unicode

@Model
class Bid(object):
	job_id = ForeignKey(Integer, 'Job.id')
	char_id = ForeignKey(Integer, 'Character.id')
	amount = Integer
	date = DateTime
	accepted = Boolean

	def accept(self):
		with transact:
			self.update(accepted=True)
			self.job.update(accepted_date=datetime.now())

@Model
class Job(object):

	user_id = ForeignKey(Integer, 'User.id')