Just thought I would seek out any good opinions before I proceed with
my data-storage plan. Please forgive the length of this post, but I
wanted to include enough data example for you to see exactly what i'm
trying to do, so that you can give me good feedback.
On the UI side, I have developed a small 'bookmarklet' that injects
itself into the game "Mafia Wars" and parses the profile page into
JSON. An example of the JSON is included below so you can see a full
data example...Essentially, the structure of the JSON object is as
follows:
{title, name, charclass, level, titles[{t,v,o}], stats[{s,v}], skills
[{s,v}], weapons[{i,c}], armor[{i,c}], vehicles[{i,c}], lots
[{i,c}],properties[{i,c}]}
Now one approach is to create objects for titles, stats, skills and
all the other 'object arrays', but then that would mean everytime i
capture a profile, I would have as many as 400-500 puts to the DB or
more to save each item. Therefore, I was thinking on maybe just
storing each value as a python array, in a blob field...in which case,
my model would look something like this:
class mwProfile(db.Model):
title=db.StringProperty()
name=db.StringProperty()
charclass=db.StringProperty()
level=db.IntegerProperty()
fb_sig_id=db.StringProperty()
date=db.DateTimeProperty(auto_now_add=True)
titles=db.BlobProperty()
stats=db.BlobProperty()
skills=db.BlobProperty()
weapons=db.BlobProperty()
armor=db.BlobProperty()
vehicles=db.BlobProperty()
lots=db.BlobProperty()
properties=db.BlobProperty()
so when the data comes into the handler, the handler would be able to
create a new instance of mwProfile, set the appropriate values from
the title, name, charclass, level and fb_sig_id, and then just create
python lists of objects and store each list in the blob property...
any suggestions? see the data below...
{"title":"Brigadir","name":"Nolybab
Praetorius","charclass":"Maniac","level":242,"fb_sig_id":"123456789",
"titles":[{"t":"Skilled Boss","v":26,"o":1},{"t":"Boss","v":25,"o":2},
{"t":"Master Underboss","v":24,"o":3},{"t":"Skilled Underboss","v":
23,"o":4},{"t":"Brigadir","v":52,"o":5},{"t":"Umelyj Boets","v":50,"o":
6},{"t":"Underboss","v":22,"o":7},{"t":"Master Consigliere","v":21,"o":
8},{"t":"Skilled Consigliere","v":20,"o":9},{"t":"Boets","v":49,"o":
10},{"t":"Matyoryj Baklan","v":48,"o":11},{"t":"Consigliere","v":
19,"o":12},{"t":"Umelyj Baklan","v":47,"o":13},{"t":"Master Capo","v":
18,"o":14},{"t":"Baklan","v":46,"o":15},{"t":"Skilled Capo","v":17,"o":
16},{"t":"Capo","v":16,"o":17},{"t":"El Soldado Principal","v":30,"o":
18},{"t":"El Soldado Experto","v":29,"o":19},{"t":"El Soldado","v":
28,"o":20},{"t":"Master Hitman","v":15,"o":21},{"t":"Skilled
Hitman","v":14,"o":22},{"t":"Hitman","v":13,"o":23},{"t":"Master
Enforcer","v":12,"o":24},{"t":"Skilled Enforcer","v":11,"o":25},
{"t":"Enforcer","v":10,"o":26},{"t":"Master Soldier","v":9,"o":27},
{"t":"Skilled Soldier","v":8,"o":28},{"t":"Master Associate","v":6,"o":
29},{"t":"Skilled Associate","v":5,"o":30},{"t":"Master Street
Thug","v":3,"o":31},{"t":"Skilled Street Thug","v":2,"o":32},
{"t":"Soldier","v":7,"o":33},{"t":"Associate","v":4,"o":34},
{"t":"Street Thug","v":1,"o":35}],
"stats":[{"s":"Jobs Completed","v":4988},{"s":"Job Assists","v":2995},
{"s":"Most consecutive days doing jobs","v":67},{"s":"Most jobs done
in one day","v":227},{"s":"Fights Won","v":21291},{"s":"Fights
Lost","v":4488},{"s":"Fights Won in Cuba","v":4941},{"s":"Death","v":
212},{"s":"Mobsters Iced","v":1721},{"s":"Mobsters Whacked","v":306},
{"s":"Hitlist Kills","v":7},{"s":"Longest Hitlist Survival","v":2},
{"s":"Successful Heist","v":1717},{"s":"Times Robbed","v":442},
{"s":"Gifts sent","v":16818},{"s":"Mega Casinos Sold","v":50},
{"s":"Wars Won","v":21},{"s":"Wars Lost","v":6},{"s":"Times Betrayed
by Mafia","v":0},{"s":"War Assists","v":176}],
"skills":[{"s":"Attack","v":477},{"s":"Defense","v":501},
{"s":"Health","v":273},{"s":"Energy","v":629},{"s":"Stamina","v":88}],
"weapons":[{"i":"Crowbar","c":1},{"i":"Sawed-off Shotgun","c":10},
{"i":"Baseball Bat","c":1},{"i":"Machine Pistol","c":86},{"i":".45 Cal
Pistol","c":5},{"i":"Grenade","c":10},{"i":"Tommy Gun","c":11},
{"i":"Chain Gun","c":20},{"i":"Machete","c":2},{"i":"Lead Pipe","c":
18},{"i":"Hacksaw","c":1},{"i":"Hatchet","c":2},{"i":"RAS-29","c":26},
{"i":"Bonus weapon","c":10},{"i":"Dubina","c":6},{"i":"Pistolet
Besshumnyj","c":12},{"i":"Boevoy Nozh","c":10},{"i":"Gadyuka-5
Pistol","c":14},{"i":".308 Sniper Rifle","c":4},{"i":"Bazooka","c":8},
{"i":"Shturmovaya Vintovka","c":8},{"i":"RAS-28 SMG","c":3},
{"i":"Revolver","c":1},{"i":".45 ACP Pistol","c":8},{"i":"Grach","c":
3},{"i":".22 Pistol","c":511},{"i":"Grenade Launcher","c":81},{"i":".
45 Revolver","c":167},{"i":"9mm Semi-Automatic","c":93},
{"i":"Butterfly Knife","c":544},{"i":"IZH-35m","c":1},{"i":"Brass
Knuckles","c":592},{"i":"Claymore","c":239},{"i":"Tactical
Shotgun","c":121},{"i":"PPSH 41 Submachine gun","c":4},{"i":"C4","c":
175},{"i":"Firebomb","c":102},{"i":"Automatic Rifle","c":154},
{"i":"Semi-Automatic Shotgun","c":66},{"i":".50 Caliber Rifle","c":53},
{"i":"RPG Launcher","c":67},{"i":"Napalm","c":41},{"i":"Machine Gun
Kelly's Gun","c":5},{"i":"Pretty Boy Floyd's .45","c":10},{"i":"Garza
9","c":59},{"i":"Baby Face Nelson's .351","c":3},{"i":"Ma Barker's
Machine Gun","c":4},{"i":"M16A1","c":154},{"i":"Dillinger's Wooden
Gun","c":1},{"i":"RA-92","c":36},{"i":"Ru-38 Pistol","c":78},
{"i":"Cane Knife","c":95},{"i":"TNT","c":178},{"i":"Gaff hook","c":
194},{"i":"Bookie's Holdout Pistol","c":94},{"i":"BA-12 Assault
Rifle","c":101},{"i":"Canonazo","c":240},{"i":"Sodium Pentothal","c":
66},{"i":"Para 322","c":57},{"i":"Pro's 2 Iron","c":3},{"i":"Russian
Bear","c":1},{"i":"Siberian Tiger","c":4},{"i":"Tora Assault
Rifle","c":4},{"i":"Liger","c":1},{"i":"RU-7 .45 Pistol","c":9},
{"i":"ASC45 ","c":25},{"i":"Cannon","c":1},{"i":"Aguila HV .50 Sniper
Rifle","c":39},{"i":"Molotok Pistol","c":4},{"i":"Ballistic Knife","c":
2},{"i":"RAS-15","c":3},{"i":"Spare","c":43},{"i":"Blunderbuss","c":3},
{"i":"Flintlock Pistols","c":1},{"i":"Bayonet","c":1},
{"i":"Musket","c":1},{"i":"Saber","c":1},{"i":"Taiga Combat
Shotgun","c":4},{"i":"Carnivore Urban Shotgun","c":30},{"i":"Ubijca
Assault Rifle","c":1},{"i":"CA-10 TMP","c":20},{"i":"Treat Bag","c":
25},{"i":"Laser Squirrel","c":1},{"i":"Frankenstein Poker Chips","c":
2}],
"armor":[{"i":"Bullet Proof Vest","c":108},{"i":"Body Armor","c":20},
{"i":"Local Guide","c":2},{"i":"Local Tough","c":8},{"i":"Camo
Fatigues","c":3},{"i":"Jungle Tracker","c":3},{"i":"Hired Thug","c":
16},{"i":"Tracksuit","c":12},{"i":"Balaclava","c":12},{"i":"Wise
Guy","c":30},{"i":"Riot Helmet","c":7},{"i":"Rebel Sniper","c":4},
{"i":"Bronezhilet","c":7},{"i":"Stab-Proof Vest","c":47},
{"i":"Ushanka","c":3},{"i":"Lucky Shamrock Medallion","c":48},
{"i":"Night Vision Goggles","c":33},{"i":"Bodyguards","c":52},
{"i":"Street Gang Member","c":73},{"i":"Ness' Fedora","c":1},
{"i":"Camouflage Body Armor","c":189},{"i":"Guerrilla Squad","c":466},
{"i":"Falsified Documents","c":162},{"i":"Federal Agent","c":62},
{"i":"Tigerskin Armored Vest","c":10},{"i":"Lefty Guns' Leather
Coat","c":94},{"i":"Red Coat","c":15},{"i":"PNV","c":17},{"i":"Armored
Briefcase","c":177},{"i":"Shturmovik","c":80},{"i":"Davy Crockett
Hat","c":1},{"i":"Tri-Point Hat","c":1},{"i":"Executive Overcoat","c":
3},{"i":"Ghost Thug","c":29},{"i":"YoZombie","c":10},{"i":"Monkey
Brain Stew","c":4},{"i":"Riot Shield","c":21}],
"vehicles":[{"i":"Motorcycle","c":10},{"i":"Sedan","c":10},
{"i":"Delivery Truck","c":12},{"i":"Armored Sedan","c":20},
{"i":"Getaway Cruiser","c":12},{"i":"Town Car","c":40},{"i":"Speed
Boat","c":2},{"i":"CM Seta","c":2},{"i":"4x4","c":2},
{"i":"Mototsykl","c":8},{"i":"Taksi","c":9},{"i":"Dvina","c":8},
{"i":"CM Venga","c":5},{"i":"Barge","c":8},{"i":"Lisitsa 32 Sedan","c":
5},{"i":"Commercial Helicopter","c":6},{"i":"Oso-12 Cargo Truck","c":
14},{"i":"Armored Truck","c":86},{"i":"Impression","c":1},
{"i":"Armored Car","c":44},{"i":"Bonnie & Clyde's B-400","c":3},
{"i":"Prop plane","c":57},{"i":"Chopper","c":54},{"i":"Mara
Serpiente","c":89},{"i":"Luxury Yacht","c":69},{"i":"Golf Cart","c":
177},{"i":"Multi-Purpose Truck","c":71},{"i":"GX9","c":73},
{"i":"Chucho FAV","c":54},{"i":"Ocelot Armored Truck","c":72},
{"i":"Montaine 320","c":129},{"i":"Track Loader","c":250},{"i":"Hu-9
Helicopter","c":36},{"i":"Armored State Car","c":474},{"i":"Police
Cruiser","c":31},{"i":"El Rey Roadster","c":1},{"i":"Cigarette
Boat","c":68},{"i":"Private Jet","c":41},{"i":"Si-14 Cargo Plane","c":
84},{"i":"Stolen Mail Truck","c":1},{"i":"Armored Limousine","c":47},
{"i":"Le Tigre","c":8},{"i":"Cherepakha Compact","c":2},{"i":"Tiger
Tank","c":2},{"i":"Tigershark Submersible","c":1},{"i":"Mini-Sub","c":
82},{"i":"Severnyy Olen Snowbike","c":1},{"i":"Barsuk SUV","c":1},
{"i":"Orel Armored Helicopter","c":56},{"i":"Osa 17 Snowmobile","c":1},
{"i":"Konstantin Cargo Carrier","c":1},{"i":"Zoloto Sports Car","c":1},
{"i":"Mystery Van","c":42},{"i":"Zombie Cow","c":4},{"i":"Dead
End","c":1},{"i":"Halloween Candy Truck","c":4},{"i":"Kraken","c":1}],
"boosts":[],
"lots":[{"i":"Abandoned Lot","c":13},{"i":"Commercial Block","c":15},
{"i":"Prime Downtown Lot","c":4}],
"properties":[{"i":"<fb:intl>Louie's Deli</fb:intl>","c":1},{"i":"Rent
House","c":124},{"i":"Italian Restaurant","c":105},{"i":"Apartment
Complex","c":81},{"i":"Mafia Mike's","c":568},{"i":"Valu-Mart","c":94},
{"i":"Marina Tourist Shops","c":31},{"i":"Office Building","c":23},
{"i":"5-Star Hotel","c":27},{"i":"Mega Casino","c":41}]
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---