class Location(db.Model):
	name = db.StringProperty()
	description = db.TextProperty()
	#creator = db.ReferenceProperty(User)
	createtime = db.DateTimeProperty(auto_now_add=True)

class Item(db.Model):
	name = db.StringProperty()
	cat = db.CategoryProperty()
	icon = db.BlobProperty()
	description = db.TextProperty()
	#creator = db.ReferenceProperty(User)
	createtime = db.DateTimeProperty(auto_now_add=True)

class Route(db.Model):
	fromLoc = db.ReferenceProperty(Location, collection_name="from")
	toLoc = db.ReferenceProperty(Location, collection_name="to")
	distance = db.IntegerProperty()
	#creator = db.ReferenceProperty(User)
	createtime = db.DateTimeProperty(auto_now_add=True)
	
class User(db.Model):
	email = db.EmailProperty()
	name = db.StringProperty()
	icon = db.BlobProperty()
	balance = db.IntegerProperty()
	createtime = db.DateTimeProperty(auto_now_add=True)
	location = db.ReferenceProperty(Location)
	
class Order(db.Model):
	item = db.ReferenceProperty(Item)
	quantity_all = db.IntegerProperty()
	quantity_available = db.IntegerProperty()
	price = db.IntegerProperty()
	sellorbuy = db.BooleanProperty()
	owner = db.ReferenceProperty(User)
	itemlocation = db.ReferenceProperty(Location)
	createtime = db.DateTimeProperty(auto_now_add=True)
	endtime = db.DateTimeProperty()

eg.
{"_model":"Location","name":"shanghai","description":"a city in china." } aghuZW9lLW1tb3IOCxIITG9jYXRpb24YAww
{"_model":"Location","name":"nanjing","description":"a city in china." } aghuZW9lLW1tb3IPCxIITG9jYXRpb24YzAEM
{"_model":"Location","name":"tokyo","description":"a city in japan." } aghuZW9lLW1tb3IPCxIITG9jYXRpb24YzQEM
{"_model":"Route","fromLoc":"aghuZW9lLW1tb3IOCxIITG9jYXRpb24YAww","toLoc":"aghuZW9lLW1tb3IPCxIITG9jYXRpb24YzAEM" ,"distance":200000}
{"_model":"Route","fromLoc":"aghuZW9lLW1tb3IOCxIITG9jYXRpb24YAww","toLoc":"aghuZW9lLW1tb3IPCxIITG9jYXRpb24YzQEM" ,"distance":2100000}
{"_model":"Route","fromLoc":"aghuZW9lLW1tb3IPCxIITG9jYXRpb24YzQEM","toLoc":"aghuZW9lLW1tb3IPCxIITG9jYXRpb24YzAEM" ,"distance":2200000}
{"_model":"Item","name":"tritanium","description":"...Very common throughout the world." ,"cat":"Minerals"} aghuZW9lLW1tb3IKCxIESXRlbRgCDA
{"_model":"Order","item":"aghuZW9lLW1tb3IKCxIESXRlbRgCDA","quantity_all":1000
	,"quantity_available":1000
	,"price":3,"sellorbuy":true,"owner":"aghuZW9lLW1tb3ILCxIEVXNlchjKAQw"
	,"itemlocation":"aghuZW9lLW1tb3IPCxIITG9jYXRpb24YzQEM"
	,"endtime":"2008-10-30 0:0:0"} 
{"_model":"Order","item":"aghuZW9lLW1tb3IKCxIESXRlbRgCDA","quantity_all":1000
	,"quantity_available":1000
	,"price":2,"sellorbuy":false,"owner":"aghuZW9lLW1tb3ILCxIEVXNlchjKAQw"
	,"itemlocation":"aghuZW9lLW1tb3IPCxIITG9jYXRpb24YzQEM"
	,"endtime":"2008-10-30 0:0:0"}