How about using the model identifier? You can get that from System Report.
It looks like this: MacBookAir4,2
This site might be helpful as it is a giant database of all Macs ever. Maybe you can get some ideas from how they've set it up:
http://www.everymac.com/systems/appl...011-specs.html