Thanks that's gr8!

On 2 Lut, 21:52, Daniel Roseman <[email protected]> wrote:
> On Wednesday, February 2, 2011 8:38:58 PM UTC, Tereska wrote:
>
> > My RequestObject must contain information about user device (mobile,
> > tablets etc) with device capatibilites (resolution, video codecs
> > etc) .
> > It's a data collection not simple string. Then I want use it in views
> > and templates.
>
> So, simply attach your information as an attribute of the standard request
> object. No need to replace it. You probably want to do this in a middleware.
>
>     class DeviceInfoMiddleware(object):
>         def process_request(self, request):
>             request.device_info = {'resolution': '800x600', 'codecs':
> ['H264', 'WebM']}
>
> --
> DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to