On Sep 25, 4:44 pm, Johannes Dollinger
<[email protected]> wrote:
> Regarding parity, let me advertise a Signer object again:
>
>         signer = signed.Signer(
>                 key=settings.SECRET_KEY,
>                 expire_after=3600
>         )
>
>         s = signer.sign(v)
>         v = signer.unsign(s)
>
>         signer.set_cookie(response, name, value)
>         signer.get_cookie(request, name)
>         # or:
>         signer.get_cookies(request)[name]
>
>         # transparently sign cookies set via response.set_cookie()
>         # and unsign cookies in request.COOKIES in place:      
>         @signer.sign_cookies
>         def view0(request):
>                 ...    
>         @signer.sign_cookies('cookie', 'names')
>         def view1(request):
>                 ...
>
> This would make more options and customization feasible (by  
> subclassing):

OK, you got me. You obviously know my weakness for customisation by
subclassing :) Having a Signer class is a smart idea, I'll kick it
around a bit and see how it looks.

Cheers,

Simon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to