django-wurfl
django-wurfl copied to clipboard
Making partial user agent matching more flexible
adding BaseDevice._match_partial_user_agent to have flexible prefix matching from 1/3rd to 1/10th of the original user-agent strinh
helps alleviate the issue raised by https://github.com/clement/django-wurfl/issues/4, although django-wurfl still doesn't have the robust type-specific partial matching that the official wurfl apis (eg, tera-wurfl) do.
I wasn't getting detection for my iPhone4 through Django-wurfl so I tried this patch. It does work for the iPhone4, however it also works for Firefox 9 on my desktop. Eeek! I think by the time it get's up to 1/10th the UA string, we'll be seeing a lot of false positives.
Even using 1/4 of the UA string leads to false positives, as it thinks that IE (or Firefox...one of them) is Windows CE, for instance.
However, using the 1/3 of the UA doesn't catch my iPhone4 running IOS 5.0.1 (5.0 is in the wurfl, but 5.0.1 isn't yet).
In any case, we'll need a better approach than simple prefix matching in the end it seems unfortunately.