On Thu, Dec 1, 2011 at 12:58 PM, Martin Tiršel <dja...@blackpage.eu> wrote:

> Hello,
>
> why this is not working?
>
> from django.db import models
>
> ...
>            GameProfile.objects.get(
>                models.Q(nick=nick) | models.Q(user=self.user),
>                world=self.world,
>            )
>
>
A shot in the dark here, but if you are getting "'module' object has no
attribute 'Q'" here, have you imported something else called 'models'? Or
redefined it somehow above this code?

Try:
from django.db import models as django_models
...
        GameProfile.objects.get(
               django_models.Q(nick=nick) | django_models.Q(user=self.user),
               world=self.world,
           )

to see if the problem goes away. If it does, it's almost definitely a
redefined name.

-- 
Regards,
Ian Clelland
<clell...@gmail.com>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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.

Reply via email to