Re: [Django] #14566: Multiple database issue v1.2.3 - Django reading the wrong database

2010-11-15 Thread Django
#14566: Multiple database issue v1.2.3 - Django reading the wrong database
---+
  Reporter:  stodge| Owner:  nobody
Status:  closed| Milestone:
 Component:  Database layer (models, ORM)  |   Version:  1.2   
Resolution:  invalid   |  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by Alex):

  * status:  new => closed
  * resolution:  => invalid

Comment:

 No response to emulbreh's query, as it looks like a bug in the user's code
 I'm going to close for now, feel free to reopen with more information.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #14566: Multiple database issue v1.2.3 - Django reading the wrong database

2010-10-26 Thread Django
#14566: Multiple database issue v1.2.3 - Django reading the wrong database
---+
  Reporter:  stodge| Owner:  nobody
Status:  new   | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by emulbreh):

 Is that a typo in the description or have you really swapped `get` and
 `using` ?
 {{{
 #!python
 Scene.objects.get(id=3).using('scenes')
 # vs
 Scene.objects.using('scenes').get(id=3)
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #14566: Multiple database issue v1.2.3 - Django reading the wrong database

2010-10-26 Thread Django
#14566: Multiple database issue v1.2.3 - Django reading the wrong database
---+
  Reporter:  stodge| Owner:  nobody
Status:  new   | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by Alex):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Old description:

> I have two PostgreSQL (postgresql_psycopg2) databases defined in my
> settings; default and scenes.
>
> If I perform a filter using the 'scenes' DB I get the expected results:
>
> Scene.objects.filter(name__contains='ME').using('scenes')
> [, ]
>
> If I perform a get(), Django seems to get completely confused and appears
> to read the data from the default database:
>
> Scene.objects.get(id=3).using('scenes')
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/usr/lib/python2.6/site-packages/django/db/models/manager.py",
> line 132, in get
> return self.get_query_set().get(*args, **kwargs)
>   File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line
> 336, in get
> num = len(clone)
>   File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line
> 81, in __len__
> self._result_cache = list(self.iterator())
>   File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line
> 269, in iterator
> for row in compiler.results_iter():
>   File "/usr/lib/python2.6/site-
> packages/django/db/models/sql/compiler.py", line 672, in results_iter
> for rows in self.execute_sql(MULTI):
>   File "/usr/lib/python2.6/site-
> packages/django/db/models/sql/compiler.py", line 727, in execute_sql
> cursor.execute(sql, params)
>   File "/usr/lib/python2.6/site-packages/django/db/backends/util.py",
> line 15, in execute
> return self.cursor.execute(sql, params)
>   File "/usr/lib/python2.6/site-
> packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in
> execute
> return self.cursor.execute(query, args)
> DatabaseError: relation "scene" does not exist
> LINE 1: ...le", "scene"."datasets", "scene"."transform" FROM "scene"
> WH...
>

> Anyone else seen this?
>
> Thanks

New description:

 I have two PostgreSQL (postgresql_psycopg2) databases defined in my
 settings; default and scenes.

 If I perform a filter using the 'scenes' DB I get the expected results:
 {{{
 Scene.objects.filter(name__contains='ME').using('scenes')
 [, ]
 }}}
 If I perform a get(), Django seems to get completely confused and appears
 to read the data from the default database:
 {{{
 Scene.objects.get(id=3).using('scenes')
 Traceback (most recent call last):
   File "", line 1, in 
   File "/usr/lib/python2.6/site-packages/django/db/models/manager.py",
 line 132, in get
 return self.get_query_set().get(*args, **kwargs)
   File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line
 336, in get
 num = len(clone)
   File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line
 81, in __len__
 self._result_cache = list(self.iterator())
   File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line
 269, in iterator
 for row in compiler.results_iter():
   File "/usr/lib/python2.6/site-
 packages/django/db/models/sql/compiler.py", line 672, in results_iter
 for rows in self.execute_sql(MULTI):
   File "/usr/lib/python2.6/site-
 packages/django/db/models/sql/compiler.py", line 727, in execute_sql
 cursor.execute(sql, params)
   File "/usr/lib/python2.6/site-packages/django/db/backends/util.py", line
 15, in execute
 return self.cursor.execute(sql, params)
   File "/usr/lib/python2.6/site-
 packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in
 execute
 return self.cursor.execute(query, args)
 DatabaseError: relation "scene" does not exist
 LINE 1: ...le", "scene"."datasets", "scene"."transform" FROM "scene" WH...
 }}}

 Anyone else seen this?

 Thanks

Comment:

 Reformatted description, please use preview.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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