View Single Post
  #5   Spotlight this post!  
Unread 22-06-2010, 15:52
Greg Marra's Avatar Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
no team (The Blue Alliance)
Team Role: RoboCoach
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,030
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: [TBA]: TBATV v4 Development Log

I discovered that App Engine has a feature called "key_names". Instead of having App Engine assign a numeric ID to a Model in the datastore, you can specify a string to use instead. Later, you can call Model.get_by_key_name(key) instead of Model.all().filter('property=', value).get(), which is faster.

We are going to use these for Models with obvious canonical names. For instance, Teams will have key_names like 'frc177', and Events will have key_names like '2010ct'. Matches get key_names like '2010ct_sf2m1'. Since we can guess the key_name for a Model we expect to exist, we can find them faster.

Neat.
__________________
Formerly Bobcat Robotics - Team 177 and X-Factor - Team 2124, now The Blue Alliance
Reply With Quote