| 86 | |
| 87 | # See if this object can be used for queries where a Q() comparing |
| 88 | # a user can be used with another Q() (in an AND or OR fashion). |
| 89 | # This simulates what a template tag might do with the user from the |
| 90 | # context. Note that we don't need to execute a query, just build it. |
| 91 | # |
| 92 | # The failure case on Python 2.4 with a LazyObject-wrapped User is a |
| 93 | # fatal TypeError: "function() takes at least 2 arguments (0 given)" |
| 94 | # deep inside deepcopy(). |
| 95 | # |
| 96 | # Python 2.5 and 2.6 succeed, but log internally caught exception spew: |
| 97 | # |
| 98 | # Exception RuntimeError: 'maximum recursion depth exceeded while |
| 99 | # calling a Python object' in <type 'exceptions.AttributeError'> |
| 100 | # ignored" |
| 101 | query = Q(user=response.context['user']) & Q(someflag=True) |