Re: BrightonPy event: The Why and How of Automated Testing with Python and Django

2010-11-04 Thread Jim Purbrick
The video and slides for this talk are now online here:
http://jimpurbrick.com/2010/11/04/why-and-how-automated-testing-python-and-django/

Cheers,

Jim

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



Strange Filter Behaviour With UUIDField

2010-10-21 Thread Jim Purbrick
I've just finished patching django.contrib.auth.User to use one of
reverie's UUIDFields (http://gist.github.com/374662) as it's primary
key.

It's mostly been pleasantly straightforward, but I was slightly
puzzled by the need for the patch below, which requires the filter to
explicitly address the id field when the primary key is a UUIDField
(but not when it's an AutoField) in order for the auth tests to pass.

Am I missing something here? Should the UUIDField or the User model be
doing something else in order for the "group__user=user_obj" filter to
work?

Cheers,

Jim

--- backends.py.old 2010-10-21 18:21:06.0 +0100
+++ backends.py 2010-10-21 17:05:19.0 +0100
@@ -25,7 +25,7 @@
 groups.
 """
 if not hasattr(user_obj, '_group_perm_cache'):
-perms = Permission.objects.filter(group__user=user_obj
+perms = Permission.objects.filter(group__user__id=user_obj.id
 ).values_list('content_type__app_label', 'codename'
 ).order_by()
 user_obj._group_perm_cache = set(["%s.%s" % (ct, name)
for ct, name in perms])

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