>>> p=EtilizeProduct.objects.all().using('etilize')[23424]
>>> p.productdescription_set.all()
[]
>>> p.productdescription_set.count()
4

Does anybody have any idea why count() returns 4, but all() returns an empty 
list? I'm not using any custom routers.

>>> str(p.productdescription_set.all().query)
'SELECT "productdescriptions"."id", "productdescriptions"."productid", 
"productdescriptions"."description", "productdescriptions"."isdefault", 
"productdescriptions"."type", "productdescriptions"."
localeid" FROM "productdescriptions" WHERE "productdescriptions"."productid" 
= 1015433472 '

When I try to enter that command into a dbshell, I get a syntax error. If I 
remove the quotation marks, I'll get the 4 results:

$ ./manage.py dbshell --database etilize
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 269
Server version: 5.1.49-1ubuntu8.1 (Ubuntu)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input 
statement.

mysql> SELECT "productdescriptions"."id", "productdescriptions"."productid", 
"productdescriptions"."description", "productdescriptions"."isdefault", 
"productdescriptions"."type", "productdescriptions"."localeid" FROM 
"productdescriptions" WHERE "productdescriptions"."productid" = 1011081147;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual 
that corresponds to your MySQL server version for the right syntax to use 
near '."id", "productdescriptions"."productid", 
"productdescriptions"."description", "' at line 1
mysql> SELECT "productdescriptions".* FROM "productdescriptions" WHERE 
"productdescriptions"."productid" = 1011081147;ERROR 1064 (42000): You have 
an error in your SQL syntax; check the manual that corresponds to your MySQL 
server version for the right syntax to use near '.* FROM 
"productdescriptions" WHERE "productdescriptions"."productid" = 10110811' at 
line 1
mysql> SELECT productdescriptions.* FROM productdescriptions WHERE 
productdescriptions.productid = 1011081147;
+------------+----------------------------------------------------------------------------------------------------------------------------+-----------+------+----------+
| productid  | description                                                   
                                                             | isdefault | 
type | localeid |
+------------+----------------------------------------------------------------------------------------------------------------------------+-----------+------+----------+
| 1011081147 | Symantec (10888497) Software Licensing                       
                                                              |         0 | 
   0 |        1 |
| 1011081147 | Symantec VERITAS Storage Foundation v.5.0 Enterprise HA for 
DB2 Crossgrade License - Government - 1 Server - Price Level S |         1 | 
   1 |        1 |
| 1011081147 | Symantec VERITAS Storage Foundation v.5.0 Enterprise HA for 
DB2                                                            |         0 | 
   2 |        1 |
| 1011081147 | Crossgrade License - Government - 1 Server - Price Level S   
                                                              |         0 | 
   3 |        1 |
+------------+----------------------------------------------------------------------------------------------------------------------------+-----------+------+----------+
4 rows in set (0.12 sec)

mysql> Bye

What could be causing this?

-- 
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