Re: Extracting the database name from an object

2011-09-28 Thread Cal Leeming [Simplicity Media Ltd]
Lol - that makes more sense :) Thanks for the clarification Tom! On Wed, Sep 28, 2011 at 10:31 AM, Tom Evans wrote: > On Tue, Sep 27, 2011 at 8:21 PM, Andre Terra wrote: > > It doesn't hurt to remind him that methods that begin with _ are >

Re: Extracting the database name from an object

2011-09-28 Thread Tom Evans
On Tue, Sep 27, 2011 at 8:21 PM, Andre Terra wrote: > It doesn't hurt to remind him that methods that begin with _ are considered > unstable API and are subject to change/removal without previous notice. > > > Cheers, > AT > However, that API is documented in a release, and

Re: Extracting the database name from an object

2011-09-27 Thread Cal Leeming [Simplicity Media Ltd]
Ohh - I actually didn't know this, thanks for giving a heads up :) Cal On Tue, Sep 27, 2011 at 8:21 PM, Andre Terra wrote: > It doesn't hurt to remind him that methods that begin with _ are considered > unstable API and are subject to change/removal without previous

Re: Extracting the database name from an object

2011-09-27 Thread Andre Terra
It doesn't hurt to remind him that methods that begin with _ are considered unstable API and are subject to change/removal without previous notice. Cheers, AT On Tue, Sep 27, 2011 at 3:51 PM, Willem Romijn wrote: > ob._state.db, according to this article: > > >

Re: Extracting the database name from an object

2011-09-27 Thread Willem Romijn
ob._state.db, according to this article: http://stackoverflow.com/questions/4146781/does-a-django-model-know-from-which-database-it-was-loaded-and-how-can-this-info 2011/9/27 Juan Pablo Romero Méndez > Hello, > > Suppose I get an object from a non-default database: > >

Re: Extracting the database name from an object

2011-09-27 Thread Cal Leeming [Simplicity Media Ltd]
Hope this helps. >>> _r = SessionIP.objects.get(id=1000) # figured this out by doing dir(_r._meta) >>> _r._meta.db_table 'ddcms_sessionip' # figured this out by looking at https://docs.djangoproject.com/en/dev/topics/db/multi-db/ >>> _r._state.db 'nats_rw' Cal 2011/9/27 Juan Pablo Romero

Extracting the database name from an object

2011-09-27 Thread Juan Pablo Romero Méndez
Hello, Suppose I get an object from a non-default database: ob = MyModel.objects.using('somedb').get(pk=1) Is it possible later to retrieve the database name just from the object? ob.db?? Regards, Juan Pablo -- You received this message because you are subscribed to the Google Groups