Luca Passani, WURFL inventor here. My company recently launched this service which pretty much solves the problem you mentioned free of charge. I advise you check out http://wurfl.io/
In a nutshell, if you import a tiny JS file:
<script type='text/javascript' src="//wurfl.io/wurfl.js"></script>
you will be left with a JSON object that looks like:
{
"complete_device_name":"Google Nexus 7",
"is_mobile":true,
"form_factor":"Tablet"
}
(that's assuming you are using a Nexus 7, of course) and you will be able to do things like:
if(WURFL.form_factor == "Tablet"){
//dostuff();
}
Or
modelName = WURFL.complete_device_name
This is what you are looking for. Please observe that the service also correctly detects specific iPhone models, which was a rather hard nut to crack.
I see someone commented that maintaining the list of devices would be a big task. He would be correct, if it wasn't that the service is doing it for you, so you don't need to keep anything updated.
Thanks