On Tue, Oct 6, 2009 at 1:32 PM, Mat <[email protected]> wrote:
>
> Okay so here is my code:
>
> ******This way works and does not error******
> rs = BadActor.objects.filter(addr__iregex='^(192\.188\.)(.*)(\.20)$');
> print len(rs);
> print rs[0].addr
>
> *******This way errors********
> q = Q({'addr__iregex':'^(192\.188\.)(.*)(\.20)$'});
>
Why the dict? Why not simply:
q = Q(addr__iregex='^(192\.188\.)(.*)(\.20)$')
If you have a dict that you want to pass as keyword args, you need to use
**:
q = Q(**{'addr__iregex':'^(192\.188\.)(.*)(\.20)$'});
Karen
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---