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
>
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
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
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:
>
>
>
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:
>
>
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
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
7 matches
Mail list logo