Re: Django dynamic multiple databases

2023-08-12 Thread ivan harold
you can check this one out https://docs.djangoproject.com/en/4.2/topics/db/multi-db/ On Saturday, August 12, 2023 at 9:44:08 AM UTC-5 pankaj palmate wrote: > I want to creating saas based application containing one super admin and > rest will be customers where each customer will have their

Django dynamic multiple databases

2023-08-12 Thread pankaj palmate
I want to creating saas based application containing one super admin and rest will be customers where each customer will have their own database .want multiple database with dynamic credentials based on request.I want the database to be identified from the subdomain provided.Is this possible

Re: Running migrations with multiple databases

2023-07-11 Thread shahee...@gmail.com
Thanks: just what I needed to know! On Tuesday, 11 July 2023 at 02:48:48 UTC+1 David Nugent wrote: Migrations are executed according to how your db routers is setup. See setting DATABASE_ROUTERS. Note that normally you would be replicating secondaries, so migrations are normally not applied

Re: Running migrations with multiple databases

2023-07-10 Thread David Nugent
Migrations are executed according to how your db routers is setup. See setting DATABASE_ROUTERS. Note that normally you would be replicating secondaries, so migrations are normally not applied on all bu the primary, so this is the default. Regards, David On Mon, Jul 10, 2023 at 10:26 PM

Running migrations with multiple databases

2023-07-10 Thread Shaheed Haque
Hi, I'm on Django 4.2 atop Postgres. In my project settings.py, I have a main/default database connection, and a second set up like this: == DATABASES = { 'default': { ... 'NAME': 'foo', # Postgres DATABASE NAME ... },

Re: Using Multiple databases

2022-04-15 Thread Ryan Nowakowski
On Wed, Apr 06, 2022 at 08:59:09AM -0700, Vasanth Mohan wrote: > I'm building a PoC for a multi-tenant app where I'm trying to use the same > schema across multiple databases with Django instance. I've got a couple of > questions and I'd be happy to have some input > > 1.

Using Multiple databases

2022-04-06 Thread Vasanth Mohan
Hello, I'm building a PoC for a multi-tenant app where I'm trying to use the same schema across multiple databases with Django instance. I've got a couple of questions and I'd be happy to have some input 1. Is there a way to define the *using()* function to use with Models via a lib

migrate exception if multiple databases migrated in a specific order

2022-02-02 Thread Robert Leach
I just added a second database to our project and was questioning my sanity when I kept getting the exception below in the remote github action tests only (not locally). I eventually noticed that I was doing the migrations in the reverse order locally. Once I noticed that, I was able to both

call the model of the secondary database in djnago using Multiple Databases

2020-06-30 Thread Pradyum Gupta
https://stackoverflow.com/q/62658396/7999665 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion

Re: Can we create a Rest Api in Django which can able to communicate with multiple databases(Relational, Non relational) dynamically. If yes please recommend me a way to do that

2019-06-23 Thread Andrew C.
anilkumar sangu wrote: > Hello, > > I am working on Django > > I have a scenario like > I want to connect multiple databases. based on user selection. if user > selects MySql from front end my Api could able to connect MySql. if user > select postgreSql my api could able to con

Re: Can we create a Rest Api in Django which can able to communicate with multiple databases(Relational, Non relational) dynamically. If yes please recommend me a way to do that

2019-06-21 Thread Chetan Ganji
+91-900-483-4183 ganji.che...@gmail.com http://ryucoder.in On Fri, Jun 21, 2019 at 4:55 PM anilkumar sangu wrote: > Hello, > > I am working on Django > > I have a scenario like > I want to connect multiple databases. based on user selection. if user > selects MySql from f

Can we create a Rest Api in Django which can able to communicate with multiple databases(Relational, Non relational) dynamically. If yes please recommend me a way to do that

2019-06-21 Thread anilkumar sangu
Hello, I am working on Django I have a scenario like I want to connect multiple databases. based on user selection. if user selects MySql from front end my Api could able to connect MySql. if user select postgreSql my api could able to connect to postgreSql based on user selection

Multiple databases in django with admin

2019-02-14 Thread Ramesh Mahajan
I am working on a project for multiple tenants. So i want to multiple databases. But i will be using django built-in auth app. I want to know what changes I should do in admin panel so that whenever admin is creating user it goes and sits in the respective databases. Thank in advance. -- You

Re: Single Django App using Multiple Databases

2018-10-02 Thread heriberto ochoa
https://django-tenant-schemas.readthedocs.io/en/latest/ El martes, 2 de octubre de 2018, 6:53:16 (UTC-6), Glen D souza escribió: > > Hi, > > I am working on a project where i am using a single django app which is > backed by different databases. > > Let me explain the use case clearly, > > I

Single Django App using Multiple Databases

2018-10-02 Thread Glen D souza
Hi, I am working on a project where i am using a single django app which is backed by different databases. Let me explain the use case clearly, I have a app say app1, and app1 data is located in two different databases say db1 and db2 data present in the db1 and db2 are different, lets say db1

Regarding Multiple Databases

2018-06-19 Thread RASHMIT PANKHANIA
hi i m here first time, my doubt is regarding using multiple(two) databases and i want to create particular table in only one database but after migrating it happens on both.you can follow the code on https://dpaste.de/arP9 -- You received this message because you are subscribed to the Google

Regarding Multiple Databases

2018-06-19 Thread RASHMIT PANKHANIA
Hello: I am Rashmit Pankhania and my doubt is regarding using multiple(two) databases and i want to create particular table in only one database but after migrating it happens on both.Also after migrating it show only django-migration table in second database.you can follow the code on

database names in queries on multiple databases

2017-07-10 Thread Florian Wegscheider
atabase name in the query? Or is there any workaround for this? I also posted this question on StackOverflow - to no avail, so I'll try here. https://stackoverflow.com/questions/45018277/django-manytomany-through-with-multiple-databases -- You received this message because you are subscribed to the Google

Multiple Databases --- Migrations

2017-02-27 Thread Luvpreet Singh
I am using 2 postgres databases in my django app. 'newpostgre': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'new_postgre2', 'USER': 'tester', 'PASSWORD': 'password', 'HOST': 'localhost', 'PORT': '', },

Re: Multiple Databases

2017-02-27 Thread ludovic coues
Have you checked your settings for typo ? 2017-02-27 10:02 GMT+01:00 Luvpreet Singh : > But dylan, I have written that > > Check1.objects.using('default').all() > > gives me error. > > On Mon, Feb 27, 2017 at 1:08 PM, Dylan Reinhold wrote: >> >> It is

Re: Multiple Databases

2017-02-27 Thread Luvpreet Singh
But dylan, I have written that Check1.objects.using('default').all() gives me error. On Mon, Feb 27, 2017 at 1:08 PM, Dylan Reinhold wrote: > It is going to use the database named default. > Checkout the doc on using mutiple DBs >

Re: Multiple Databases

2017-02-26 Thread Dylan Reinhold
It is going to use the database named default. Checkout the doc on using mutiple DBs https://docs.djangoproject.com/en/1.10/topics/db/multi-db/ Dylan On Sun, Feb 26, 2017 at 11:17 PM, Luvpreet Singh wrote: > Hi everyone, > > I am using 2 databases in my django app. One

Multiple Databases

2017-02-26 Thread Luvpreet Singh
Hi everyone, I am using 2 databases in my django app. One is default sqlite and second is postgre. Now, I make a simple model named Check1 in my app, having only title attribute. class Check1(models.Model): title = models.CharField(max_length=100) Now, in my shell, >> from

Re: multiple databases - two questions

2017-01-03 Thread Fred Stluka
-db/#using-managers-with-multiple-databases ... but I don't quite understand. There are no custom managers involved; only the out-of-the-box MyModel.objects. Q1. Should I be using db_manager

Re: multiple databases - two questions

2017-01-02 Thread Mike Dewhirst
called 'production' then read from 'default' and write to 'production'. (I need to check we are on the staging server). The docs say ... https://docs.djangoproject.com/en/1.8/topics/db/multi-db/#using-managers-with-multiple-databases ... but I don't quite understand. There are no custom managers

Re: multiple databases - two questions

2017-01-02 Thread Fred Stluka
://docs.djangoproject.com/en/1.8/topics/db/multi-db/#using-managers-with-multiple-databases ... but I don't quite understand. There are no custom managers involved; only the out-of-the-box MyModel.objects. Q1. Should I be using db_manager

Re: Migrations and multiple databases

2016-11-25 Thread odd hogstad
Isn't that kind of stupid? fredag 25. november 2016 06.00.49 UTC+1 skrev pradam.programming følgende: > > Yes do the same. > > On Thu, Nov 24, 2016 at 11:16 PM, odd hogstad > wrote: > >> db1 holds the auth stuff already. Do I need to also have it in db2 for >> the

Re: Migrations and multiple databases

2016-11-24 Thread pradam programming
Yes do the same. On Thu, Nov 24, 2016 at 11:16 PM, odd hogstad wrote: > db1 holds the auth stuff already. Do I need to also have it in db2 for the > migrations to work? > > torsdag 24. november 2016 12.22.14 UTC+1 skrev pradam.programming følgende: >> >> hi Hogstad, >>

Re: Migrations and multiple databases

2016-11-24 Thread odd hogstad
db1 holds the auth stuff already. Do I need to also have it in db2 for the migrations to work? torsdag 24. november 2016 12.22.14 UTC+1 skrev pradam.programming følgende: > > hi Hogstad, > Before doing app migrate please python manage.py migrate auth ==>I hope > this will solve the issue > > On

Re: Migrations and multiple databases

2016-11-24 Thread pradam programming
hi Hogstad, Before doing app migrate please python manage.py migrate auth ==>I hope this will solve the issue On Thu, Nov 24, 2016 at 3:54 PM, odd hogstad wrote: > I have two databases in my project, db1, which changes quite frequently, > and db2, which seldom changes.

Migrations and multiple databases

2016-11-24 Thread odd hogstad
I have two databases in my project, db1, which changes quite frequently, and db2, which seldom changes. The app was original written in django 1.3, but we've upgraded since then, and now uses 1.8. Now I need to make a change on db2 for the first time since the upgrade from 1.3. I make my

multiple databases - two questions

2016-11-03 Thread Mike Dewhirst
' and write to 'production'. (I need to check we are on the staging server). The docs say ... https://docs.djangoproject.com/en/1.8/topics/db/multi-db/#using-managers-with-multiple-databases ... but I don't quite understand. There are no custom managers involved; only the out-of-the-box

multiple databases - two questions

2016-11-03 Thread Mike Dewhirst
to check we are on the staging server). The docs say ... https://docs.djangoproject.com/en/1.8/topics/db/multi-db/#using-managers-with-multiple-databases ... but I don't quite understand. There are no custom managers involved; only the out-of-the-box MyModel.objects. Q1. Should I be using

Re: Migrations with multiple databases

2016-10-27 Thread marcin . j . nowak
On Tuesday, October 25, 2016 at 5:05:46 PM UTC+2, andrea crotti wrote: > > We have a couple of databases with a tiny number of tables, but > django-migrations has still go through all the migrations anyway. > So even if the SQL itself is nothing it still takes a massive amount of > time and

Re: Migrations with multiple databases

2016-10-27 Thread andrea crotti
Ah nice thanks Markus, however - different subsets of INSTALLED_APPS sounds a bit hacky, how would I do it anyway? checking in the settings which database is being migrated and providing a different list? Or any other way? - MIGRATION_MODULES sounds a bit safer, but I'm not sure it gives

Re: Migrations with multiple databases

2016-10-25 Thread Markus Holtermann
Hi Andrea, If you have models that are entirely unrelated in different databases you could use different values for INSTALLED_APPS to limit the apps Django sees or by settings the values in the MIGRATION_MODULES dict to None to tell Django that those apps don't have migrations. Cheers, /Markus

Migrations with multiple databases

2016-10-25 Thread andrea crotti
We have a couple of databases with a tiny number of tables, but django-migrations has still go through all the migrations anyway. So even if the SQL itself is nothing it still takes a massive amount of time and memory for the usual known issues with migrations on big projects. I guess it works

Test cases are always referring to default database in case of Multiple databases

2016-06-08 Thread vaibhav
Hi, I am trying to run some test cases on one of the apps of my Django Project. My settings.py file specifies two different databases as follows: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR,

Applying migrations to multiple databases in django?

2016-04-07 Thread Amir Meirbekov
Please, take a look at this question <http://stackoverflow.com/questions/36469216/applying-migrations-to-multiple-databases-in-django>. Spent whole day screening source code, but still can't figure out the problem. -- You received this message because you are subscribed to the Google

Re: Unintuitive behaviour of management commands with multiple databases

2016-02-02 Thread 'Vinay Sajip' via Django users
Dear Carl, On Tuesday, February 2, 2016 at 7:51:20 PM UTC, Carl Meyer wrote: > > > There's nothing wrong with connections[options.get('database')] if you > want to get a specific database connection object; that's public API and > you can use it. In the case of the built-in commands, that's

Re: Unintuitive behaviour of management commands with multiple databases

2016-02-02 Thread Carl Meyer
Hi Vinay, On 02/02/2016 12:14 PM, 'Vinay Sajip' via Django users wrote: > I'm not arguing for any particular different routing scheme to be > included - only for management commands to be able to be written to > respect --data arguments passed to them, and which can easily treat the > passed

Re: Unintuitive behaviour of management commands with multiple databases

2016-02-02 Thread 'Vinay Sajip' via Django users
t just open a > > transaction on that database, but also make it the default for the scope > > of the block (except if explicitly overridden by using() for particular > > models in code called from that block). The current behaviour seems to > > violate the principle of leas

Re: Unintuitive behaviour of management commands with multiple databases

2016-02-02 Thread Carl Meyer
vise against > that). The proper (and thread-safe) way to achieve the equivalent is to > > Well, for any given run of the application (on which the example I > posted is based), only one database is ever used. The idea of multiple > databases was to allow us to select which one

Re: Unintuitive behaviour of management commands with multiple databases

2016-02-02 Thread 'Vinay Sajip' via Django users
e equivalent is to > Well, for any given run of the application (on which the example I posted is based), only one database is ever used. The idea of multiple databases was to allow us to select which one is used for any particular Python process run, and we expected to be able to run mana

Re: Unintuitive behaviour of management commands with multiple databases

2016-02-02 Thread Carl Meyer
Hi Vinay, On 02/02/2016 09:52 AM, 'Vinay Sajip' via Django users wrote: > > On Tuesday, February 2, 2016 at 3:27:10 PM UTC, Carl Meyer wrote: > > Nothing in your code ever "overrides" settings.DATABASES['default']. > > > Dear Carl, > > Thanks for the quick response. I /had/ thought of

Re: Unintuitive behaviour of management commands with multiple databases

2016-02-02 Thread 'Vinay Sajip' via Django users
On Tuesday, February 2, 2016 at 3:27:10 PM UTC, Carl Meyer wrote: > > Nothing in your code ever "overrides" settings.DATABASES['default']. > Dear Carl, Thanks for the quick response. I *had* thought of that, and tried adding the statement settings.DATABASES['default'] =

Re: Unintuitive behaviour of management commands with multiple databases

2016-02-02 Thread Carl Meyer
hing in your code ever "overrides" settings.DATABASES['default']. Defining an atomic block on a certain database has no effect on the default database within that block, it just opens a transaction on the requested database. "Which database is default" and "which database(s

Unintuitive behaviour of management commands with multiple databases

2016-02-02 Thread 'Vinay Sajip' via Django users
I've set up a simple project using with two databases, foo and bar in settings.py: DATABASES = { 'foo': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'foo.sqlite'), }, 'bar': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME':

Re: Multiple databases in Django 1.7

2015-12-09 Thread Łukasz Pauszek
ev/topics/db/multi-db/#topics-db-multi-db-routing > > I have tried this last week and it works fine. > > On Wednesday, December 9, 2015 at 2:47:42 AM UTC-8, Łukasz Pauszek wrote: >> >> Hello, >> I'm trying to configure project in Django 1.7 to use multiple database

Re: Multiple databases in Django 1.7

2015-12-09 Thread learn django
Pauszek wrote: > > Hello, > I'm trying to configure project in Django 1.7 to use multiple databases, > for now I'm following official documentation to configure 2 dbs. > Problem is that when I run: ./manage.py makemigrations myapp only changes > in default database are detecte

Multiple databases in Django 1.7

2015-12-09 Thread Łukasz Pauszek
Hello, I'm trying to configure project in Django 1.7 to use multiple databases, for now I'm following official documentation to configure 2 dbs. Problem is that when I run: ./manage.py makemigrations myapp only changes in default database are detected. And ./manage.py migrate --database

Re: Multiple databases

2015-05-19 Thread Galia Ladiray
It depends what you need, We use redis for non sql, and postgres for sql, You can use an id field to have a link between them. Django 1.8 has a support for postgres specific fields like HStore, maybe this is good enough for you? Galia On Tuesday, May 19, 2015 at 2:40:17 AM UTC+2, Roger Dunn

Re: Multiple databases

2015-05-18 Thread Javier Guerra Giraldez
On Mon, May 18, 2015 at 7:35 PM, Roger Dunn wrote: > The use case is that the normalized data will be fetched often, is very > tabular in nature, and the additional data is more document centric and will > be fetch less often, by quite a margin. have you considered

Multiple databases

2015-05-18 Thread Roger Dunn
I'm spinning up a new project and nearly all of the data I need to store can be normalized. Along with this normalized data is one piece that is better suited to a nosql database. The use case is that the normalized data will be fetched often, is very tabular in nature, and the additional

Re: Seems like a geodjango bug with multiple databases

2015-02-21 Thread Luan Nguyen
Hi, sorry for my late response. Thanks for replying. I'm using django 1.7.4. Going with this Room.objects.using('another').select_related('hotel').get(pk=10) is fine, I can then get room.hotel without any problem. I also followed Jani's advice and changed default manager of Room to

Re: Seems like a geodjango bug with multiple databases

2015-02-20 Thread Jani Tiainen
On Wed, 18 Feb 2015 06:45:15 -0800 (PST) Luan Nguyen <liha...@gmail.com> wrote: > I'm using geodjango and multiple databases, and experiencing a quite weird > situation, I guess it's a kind of bug but not absolutely sure since I'm > pretty new to Django. > > Her

Re: Seems like a geodjango bug with multiple databases

2015-02-19 Thread George Silva
hat. > > http://groups.google.com/group/geodjango > > Collin > > > On Wednesday, February 18, 2015 at 9:45:15 AM UTC-5, Luan Nguyen wrote: >> >> I'm using geodjango and multiple databases, and experiencing a quite >> weird situation, I guess it's a kind of bu

Re: Seems like a geodjango bug with multiple databases

2015-02-19 Thread Collin Anderson
://groups.google.com/group/geodjango Collin On Wednesday, February 18, 2015 at 9:45:15 AM UTC-5, Luan Nguyen wrote: > > I'm using geodjango and multiple databases, and experiencing a quite weird > situation, I guess it's a kind of bug but not absolutely sure since I'm > pretty new to Djan

Seems like a geodjango bug with multiple databases

2015-02-18 Thread Luan Nguyen
I'm using geodjango and multiple databases, and experiencing a quite weird situation, I guess it's a kind of bug but not absolutely sure since I'm pretty new to Django. Here is how to reproduce the problem: - Set up another database besides default: DATABASES = { 'default': { 'ENGINE

Multiple databases and admin list_filter

2014-09-24 Thread Pam Suebvisai
Hi, I'm trying to use multiple databases with the admin interface by separating the 2 databases to 2 admin sites following the example at https://docs.djangoproject.com/en/1.7/topics/db/multi-db/#exposing-multiple-databases-in-django-s-admin-interface. However, when I add list_filter

RE: Is it possible to get working django transaction with django multiple databases

2014-06-16 Thread Ilya Kazakevich
jango transaction with django multiple >databases > >Hi there. I'm trying to get a django site working with multiple databases, it >means a DB1 for django site an another existing DB2 (say a legacy BD) but I >need >transactions enabled. I need to run queries over BD2 that depen

Is it possible to get working django transaction with django multiple databases

2014-06-16 Thread Juan Jose Huelga
Hi there. I'm trying to get a django site working with multiple databases, it means a DB1 for django site an another existing DB2 (say a legacy BD) but I need transactions enabled. I need to run queries over BD2 that depends on queries over DB1 and the other way around. If any of these queries

Problem with syncdb and multiple databases

2013-11-11 Thread Sells, Fred
I'm using Django 1.5 and Mysql 5.1 and am in the early stages of a multiple app development and the schema is changing frequently as "hidden" requirements emerge. I cannot get syncdb to sync anything other than my default db, and when I change my default, it still seems to see the old one.

Re: Django 1.6 transactions witn multiple databases

2013-11-08 Thread Vaal
Thx! How have I missed this ... пятница, 8 ноября 2013 г., 9:47:22 UTC+4 пользователь akaariai написал: > > On Thursday, November 7, 2013 3:36:17 PM UTC+2, Vaal wrote: >> >> Hi >> How to be in 1.6 with queries that involve multiple databases? >> Previousl

Re: Django 1.6 transactions witn multiple databases

2013-11-07 Thread akaariai
On Thursday, November 7, 2013 3:36:17 PM UTC+2, Vaal wrote: > > Hi > How to be in 1.6 with queries that involve multiple databases? > Previously recommended to create custom TransactionMiddleware. It was > convenient. Now TransactionMiddleware is deprecated. > You can set A

Re: Django 1.6 transactions witn multiple databases

2013-11-07 Thread Vaal
err queries = requests -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Django 1.6 transactions witn multiple databases

2013-11-07 Thread Vaal
Hi How to be in 1.6 with queries that involve multiple databases? Previously recommended to create custom TransactionMiddleware. It was convenient. Now TransactionMiddleware is deprecated. -- You received this message because you are subscribed to the Google Groups "Django users&q

Re: multiple databases and syncdb problem

2013-10-30 Thread Tom Evans
b will only synch one DB at a time, and as Simon says, it will default to 'default' if you do not specify a database. If you have multiple databases, you need to call syncdb once for each of them. A warning, if you have South installed, syncdb gains a '--all' argument; this does not synch to all datab

Re: multiple databases and syncdb problem

2013-10-29 Thread Simon Charette
syncdb defaults to syncing the 'default' database when no --database is specified . Try specifying which database to synchronize, with the --database=inserv flag in your case. Le mardi 29 octobre 2013

multiple databases and syncdb problem

2013-10-29 Thread Sells, Fred
I can syncdb OK if I don't add allow_syncdb to my router, but if I add the allow_syncdb to the router, only my default db is synced. Any idea what I'm doing wrong, code is: def allow_syncdb(self, db, model): print 'allow syncdb for* Inserv Router', db,

Re: Managing transactions using multiple databases

2013-07-08 Thread Leandro Boscariol
Amazing work Christophe, congrats! Lot's of new cool stuff being added to 1.6, looking forward to it. Regarding the nested xact context managers, let's say something that I don't like happened and I want to abort everything: with xact(using=db1): with xact(using=db2): obj1 =

Re: Managing transactions using multiple databases

2013-07-06 Thread Christophe Pettus
On Jul 6, 2013, at 8:58 PM, Leandro Boscariol wrote: > And also thanks for mentioning xact, I wasn't aware of that! Full disclosure: I wrote it. :) In 1.6, the new atomic() decorator / context manager is the way to go, but xact() works fine for now! -- -- Christophe Pettus

Re: Managing transactions using multiple databases

2013-07-06 Thread Leandro Boscariol
Well, even though without true two-phase commit, for now that will do, thanks. And also thanks for mentioning xact, I wasn't aware of that! Cheers, Leandro On Saturday, July 6, 2013 10:41:11 AM UTC-3, Christophe Pettus wrote: > > > On Jul 6, 2013, at 2:54 PM, Leandro Boscariol wrote: > > >

Re: Managing transactions using multiple databases

2013-07-06 Thread Christophe Pettus
On Jul 6, 2013, at 2:54 PM, Leandro Boscariol wrote: > How can I do a transaction management in both databases at the same time? Is > that even possible? You can certainly nest the transaction context managers (atomic() in 1.6+, or you can use xact() in 1.5 and earlier): with

Managing transactions using multiple databases

2013-07-06 Thread Leandro Boscariol
topics/db/transactions/>even when having multiple databases is also trivial, simply select which one the transaction is about. At a given point, I'll have to interact with both databases in the same view. Consider the snippet below as an example (not tested, nor this is what I

Re: How to create a Django Group in case of multiple databases.

2013-02-09 Thread Bill Freeman
It is wrong. As Tom pointed out, you must use: def save(self, *args, **kwargs): And then, wherever you call the super class save method, use: super(ModelName, self).save(*args, **kwargs) You also don't need the first setting of modified_date_time, since the second will happen

Re: How to create a Django Group in case of multiple databases.

2013-02-08 Thread laxmikant ratnaparkhi
I have not trimmed traceback. This is ouput came on python manage.py shell. And one more thing I modified save method This looks like this: def save(self): if not self.id: self.created_date_time = datetimeToUTC() self.modified_date_time = datetimeToUTC()

Re: How to create a Django Group in case of multiple databases.

2013-02-07 Thread Tom Evans
On Thu, Feb 7, 2013 at 12:16 PM, laxglx wrote: > > Hello Everybody, > > I'm going to create a Group using Django Group. > > I have two databases one is "master" and another is "slave" > In master I created a user and group as usual. > > And in slave database I tried like this:

How to create a Django Group in case of multiple databases.

2013-02-07 Thread laxglx
Hello Everybody, I'm going to create a Group using Django Group. I have two databases one is "master" and another is "slave" In master I created a user and group as usual. And in slave database I tried like this: *>>> Group.objects.db_manager('slave').create(name="grp1")* This returned

Re: Trying to find something in multiple databases... Confused...

2012-06-19 Thread Melvyn Sopacua
On 19-6-2012 9:46, Laurence MacNeill wrote: > On Monday, June 18, 2012, Melvyn Sopacua wrote: > >> On 18-6-2012 9:52, Laurence MacNeill wrote: >>> well -- I hit the wrong key and posted that before I was finished >> typing... >>> >>> here's what's in my views.py file: >>> def index(request) >>>

Re: Trying to find something in multiple databases... Confused...

2012-06-19 Thread Laurence MacNeill
as answered your question, but a quick note on terminology: > what you've got there are separate *database tables*, or separate *Django > models* -- not separate databases. Multiple databases is a whole different > question, which you really don't want to get into as a newbie (or, indeed, >

Re: Trying to find something in multiple databases... Confused...

2012-06-19 Thread Laurence MacNeill
On Monday, June 18, 2012, Melvyn Sopacua wrote: > On 18-6-2012 9:52, Laurence MacNeill wrote: > > well -- I hit the wrong key and posted that before I was finished > typing... > > > > here's what's in my views.py file: > > def index(request) > > current_username = os.environ['REMOTE_USER'] >

Re: multiple databases [was]Trying to find something in multiple databases... Confused...

2012-06-18 Thread Kurtis Mullins
ing across multiple engines is never easy -- one typically > has to implement the equivalent of "select ... from ... join ..." in > program code -- that is, fetch records from each engine and merge them > by hand to produce a result set. > >Second is: multiple databas

Re: multiple databases [was]Trying to find something in multiple databases... Confused...

2012-06-18 Thread Kurtis Mullins
> > On Mon, Jun 18, 2012 at 9:30 AM, Daniel Roseman > wrote: There are certain "advanced" features of Django - multiple DBs, model > subclassing, that sort of thing I feel there's quite a few problems that would be relatively unsolvable without model subclassing. At

Re: multiple databases [was]Trying to find something in multiple databases... Confused...

2012-06-18 Thread Daniel Roseman
On Monday, 18 June 2012 13:16:55 UTC+1, lawgon wrote: > > On Mon, 2012-06-18 at 05:12 -0700, Daniel Roseman wrote: > > Multiple databases is a whole different > > question, which you really don't want to get into as a newbie (or, > > indeed, > > at all if possi

Re: multiple databases [was]Trying to find something in multiple databases... Confused...

2012-06-18 Thread kenneth gonsalves
On Mon, 2012-06-18 at 05:12 -0700, Daniel Roseman wrote: > Multiple databases is a whole different > question, which you really don't want to get into as a newbie (or, > indeed, > at all if possible). could you elaborate on this - I was thinking on getting into multiple databas

Re: Trying to find something in multiple databases... Confused...

2012-06-18 Thread Daniel Roseman
iews.py file: > def index(request) > current_username = os.environ['REMOTE_USER'] > > So Melvyn has answered your question, but a quick note on terminology: what you've got there are separate *database tables*, or separate *Django models* -- not separate databases. Multiple databases is

Re: Trying to find something in multiple databases... Confused...

2012-06-18 Thread Melvyn Sopacua
On 18-6-2012 9:52, Laurence MacNeill wrote: > well -- I hit the wrong key and posted that before I was finished typing... > > here's what's in my views.py file: > def index(request) > current_username = os.environ['REMOTE_USER'] And you're sure this works? Try: return

Re: Trying to find something in multiple databases... Confused...

2012-06-18 Thread Laurence MacNeill
well -- I hit the wrong key and posted that before I was finished typing... here's what's in my views.py file: def index(request) current_username = os.environ['REMOTE_USER'] This should provide me with their username (yes I do have 'import os' at the top of the file)... Now, after I get

Trying to find something in multiple databases... Confused...

2012-06-18 Thread Laurence MacNeill
Ok, I'm a total django noob here, so I am probably doing this wrong... But here goes... When someone comes to my django app's root (index), I need to verify their user-name (which is stored in a Linux environment variable). Based on where (or if) I find their user-name, I want to send them

Multiple databases or Redis/Stats/Graphite/Loggly

2012-05-02 Thread Jean-Mark
Hi all, I'm working on an app that will store gps coordinates from devices. That information will come in every 5 or so minutes of each hour. So it's alot of data. Any recommendations on how I should store this? Do I use multiple databases and use say MongoDB or Couch for the storage

ModelChoiceField with multiple databases

2011-12-21 Thread Brian Craft
Is there an easy way to use a ModelChoiceField with multiple databases? The only thing I've seen that looks promising is overriding the form __init__ and setting the queryset for the field. Seems kinda clunky. -- You received this message because you are subscribed to the Google Groups "D

Re: Problems on using multiple databases

2011-08-24 Thread Jianbao Tao
Reinout, Thanks so much for your help. I think I have figured out the solution. I posted it on https://groups.google.com/forum/?hl=en#!topic/django-users/zwMWNdIqB3A. Please take a look. Jianbao On Wed, Aug 24, 2011 at 10:13 AM, Reinout van Rees wrote: > On 24-08-11

Tips for setting up multiple databases routing in Django

2011-08-24 Thread Jim
First of all, I would like to thank Reinout van Rees ( http://reinout.vanrees.org/) for his helpful suggestions. Suppose you have two databases, 'default' and 'test', and one app, 'books'. And you want to store the models in books in the database 'test'. According to the guide from Django

Re: Problems on using multiple databases

2011-08-24 Thread Reinout van Rees
On 24-08-11 17:57, Jianbao Tao wrote: Now './manage.py syncdb' can run through with no problems. However, it doesn't create the database 'test.sqlite', which means the models in the app, books, are still installed in the default database. That's in the django docs: syncdb only managed the

Re: Problems on using multiple databases

2011-08-24 Thread Jianbao Tao
Thank you, Reinout. I changed the definition of 'allow_syncdb' to the following: def allow_syncdb(self, db, model): # db is a string of database name. label = model._meta.app_label if label == 'books': dbName = 'test' else: dbName =

Re: Problems on using multiple databases

2011-08-24 Thread Reinout van Rees
On 23-08-11 01:31, Jim wrote: django.db.utils.DatabaseError: no such table: django_content_type Which django version, btw? Early 1.2 beta versions had a bug: https://code.djangoproject.com/ticket/12999 Reinout -- Reinout van Reeshttp://reinout.vanrees.org/

Re: Problems on using multiple databases

2011-08-24 Thread Reinout van Rees
On 23-08-11 01:31, Jim wrote: def allow_syncdb(self, db, model): # db is a string of database name. label = model._meta.app_label if label == 'books': dbName = 'test' else: dbName = None return dbName == db I'd do the

Re: Problems on using multiple databases

2011-08-23 Thread Jim
Still stuck on this problem. Can anybody help me out, please? It would be much appreciated. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/K9twgNZcE4IJ.

Problems on using multiple databases

2011-08-22 Thread Jim
Hello folks, I am learning to set up multiple databases routing in Django. Before I started, I had everything working properly. Then, I wrote dbrouter.py under the site directory, basically by copying the example in the Django document about using multiple databases<ht

  1   2   3   >