CMS_PERMISSION: optionally use raw id user lookups

The "view restrictions" and "page permissions" inlines on the "page"
admin change forms can cause performance problems where there are many
thousands of users being put into simple select boxes. Added a new
setting (CMS_RAW_ID_USERS) that, if set, forces the inlines on that page
to use standard Django admin "raw ID" lookups rather than select boxes.
The restriction on which users may be selected should still be honoured
by the new widget because we set the 'limit_choices_to' attribute to be
the same as the queryset on the original widget.

Using raw_id_fields in combination with limit_choices_to blows up if you
have many thousands of users. For this reason, we only apply this limit
if the number of users is relatively small (< 500, though that figure is
somewhat arbitrary). If the number of users we need to limit to is
greater than that, we use the usual input field instead unless the user
is a CMS superuser, in which case we bypass the limit. Unfortunately,
this means that non-superusers won't see any benefit from this change.
Removed unused import
.count() rather than len() for performance boost
CMS_RAW_ID_USERS: added default setting + docs

Also removed the previous version bump so it can merge cleanly upstream.
clearer conditional check
Merge branch 'develop' into raw_id_users

Conflicts:
	cms/conf/global_settings.py
Only use raw ID above a certain number of users

So the RAW_ID_USERS setting should now be either left as False or set to
a positive integer which will be the threshold for the number of users
above which the raw ID widget will be used.
import typo
Switch from __getattribute__ to classproperty

Added the new classproperty helper in cms.utils.helpers.
cookie middleware added
tutorial changes
permission fixes and other test fixes
fixes testsuite
cleanup
only sets cookie if changed or not there
fix mysql datetime fuck up
Merge pull request #1704 from digi604/cookie-middleware

language cookie middleware added
Merge pull request #1707 from mkoistinen/develop

HTML classes added when cms_toolbar and switcher is ON
Merge pull request #1705 from digi604/perm-fix

Fixed that pages not with view perm are not anymore displayed in menu
Merge pull request #1481 from Maplecroft/raw_id_users

CMS_PERMISSION: optionally use raw id user lookups