Multiple DB

2020-07-12 Thread Soumen Khatua
Hi Folks, Actually I want to set up multiple Databases like one DB for User-specific table and another DB for Blog Post, But in this case, User should be a Foreign Key in Post table. Is it possible to do that, if it is then How I can write a query(ORM)? Thank you Regards, Soumen -- You receiv

Django Pytest with multiple db including legacy one

2019-09-25 Thread Matthieu Texier
Hi Guys, Not sure this question is on purpose as not purely Django related … I am building a frontend using two databases : one for Django and a legacy database my frontend needs to access to (read-only). As such, I do have managed models with a Django managed db and unmanaged models in an unm

Re: Multiple DB - Accessing another app's table/model?

2017-07-20 Thread miguel vfx
appA is on project A. appB is on project B. -- As it turns out, migrate names the tables as [app]_[model_name] and thus with different app names on different projects, I was initially accessing the table migrate --database=created. To access the table on another server, match the table names

Re: Multiple DB - Accessing another app's table/model?

2017-07-18 Thread Avraham Serour
import the Model and query it. from appB.models import Table Table.objects.all() On Tue, Jul 18, 2017 at 6:01 PM, miguel vfx wrote: > Hello, > > After following through the documentation, I was able to query data from > another database. However, I was only able to access the table of the same

Multiple DB - Accessing another app's table/model?

2017-07-18 Thread miguel vfx
Hello, After following through the documentation, I was able to query data from another database. However, I was only able to access the table of the same app name. How can I query data from a different app name? For example: appA has a model client_data. It's table name in the app_db database

multiple db in admin [how-to]

2017-05-19 Thread Nikos Skalis
Hi guys, Could you please advise in the following: registry is the project, BGP is the app, default is the sqlite db, registry is a postgres db the admin.py looks like this: class MultiDBModelAdmin(admin.ModelAdmin): # A handy constant for the name of the alternate database. using =

Re: "Error creating new content types" with multiple DB router

2016-04-12 Thread Jim T
Carlton, we have the exact same issue you described. It took a lot of searching to even find someone who has the same problem which led us to the conclusion that we just didn't understand how to perform migrations with DB Routers in play. As you described, we have: Database A - contains the s

"Error creating new content types" with multiple DB router

2015-12-15 Thread Carlton Gibson
Hi, Using multiple DBs, with most models in the "default" db but models for a single app being stored in a second DB, I've more or less copied the example from the docs for a custom database router. (My example is essentia

Creating a custom Model Field accessing multiple DB fields

2011-09-23 Thread Tim Chase
Having read through [1] and experimented with it a bit, I've been unable to determine whether my failure is due to a Django limitation or if it's my own fault. My question comes in two parts: 1) Can a custom model-field interface with more than one DB field? The .db_type() method's return-si

Re: authenticate problem with multiple db ?

2010-06-23 Thread Russell Keith-Magee
On Thu, Jun 24, 2010 at 1:25 AM, Keats wrote: > Hi, > when authenticate is called i get this error http://dpaste.com/210674/ > though the user exist in database... is authenticate known to not work > with multiple database context ? I'm not aware of any problems. The authenticate code doesn't do

authenticate problem with multiple db ?

2010-06-23 Thread Keats
Hi, when authenticate is called i get this error http://dpaste.com/210674/ though the user exist in database... is authenticate known to not work with multiple database context ? my register function was working fine before that... i've tried with @transaction.autocommit in place of @transaction.c

Re: Multiple DB in django 1.2

2010-02-25 Thread Russell Keith-Magee
On Fri, Feb 26, 2010 at 2:08 AM, Roach, Marshall (MROACH) wrote: > Hi, I was at pycon last week and heard about the db routers in django 1.2 > and I have the alpha version of django running for a project I’m running and > trying to figure out how to do the following. > > I have 2 databases on diff

Multiple DB in django 1.2

2010-02-25 Thread Roach, Marshall (MROACH)
Hi, I was at pycon last week and heard about the db routers in django 1.2 and I have the alpha version of django running for a project I¹m running and trying to figure out how to do the following. I have 2 databases on different machines and if its one of the models I want the database to write ev

Connecting to multiple db masters

2009-10-23 Thread dave
I've encountered the multiple database issue but with a twist. I want to propagate data across a dual master Oracle database setup which seems to be a little different topic than the online discussions I've seen. In order to do this I want to pass the url for both domains to Oracle as the connec

Select multiple db items and print

2009-03-17 Thread bsisco
i know that this is probably a RTFM situation but i've been through it and can't seem to find what i'm looking for. i would like to be able to have a table very similar to the change_list in the admin. within that table i would like to be able to select multiple records via checkboxes then print

multiple-db-support: reference model using different database

2007-09-21 Thread Carlos Hanson
this post to request help understanding why that would be a problem, but the process of composing this email made me focus on the question and come of with an answer. Now it seems kind of silly that it was a question, but I was trying to refactor my applicatio with the multiple-db-support. I&#

Re: merging multiple-db-support branch with svn trunk checkout

2007-09-21 Thread Carlos Hanson
On Sep 20, 7:39 pm, "Ben Ford" <[EMAIL PROTECTED]> wrote: > It would be a good time wouldn't it?! ;-) > > Sorry I didn't add my 2c worth yesterday, I was extremely busy and will > remain so for the next week or 2. I've sent a message to the list regarding > the latest patch to the branch and also

Re: merging multiple-db-support branch with svn trunk checkout

2007-09-20 Thread Ben Ford
e done that and understand it is a standalone > > check out. My wording was imprecise. It should have been something > > like the following: > > > > I am using the latest development version of Django (0.97). I want to > > add multiple-db-support. Because I am us

Re: merging multiple-db-support branch with svn trunk checkout

2007-09-20 Thread Russell Keith-Magee
have been something > like the following: > > I am using the latest development version of Django (0.97). I want to > add multiple-db-support. Because I am using features of 0.97 and > multiple-db-support is based on 0.96. I can't switch to the mutliple- > db-support branch. Is

Re: merging multiple-db-support branch with svn trunk checkout

2007-09-20 Thread Carlos Hanson
On Sep 19, 5:32 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 9/20/07, Carlos Hanson <[EMAIL PROTECTED]> wrote: > > > > > Greetings, > > > I am using the current svn checkout of the trunk and would like to > > include the

Re: merging multiple-db-support branch with svn trunk checkout

2007-09-19 Thread Russell Keith-Magee
On 9/20/07, Carlos Hanson <[EMAIL PROTECTED]> wrote: > > Greetings, > > I am using the current svn checkout of the trunk and would like to > include the multiple-db-support branch. What is the best way to do > this? I will understand if the answer is read the svn manu

merging multiple-db-support branch with svn trunk checkout

2007-09-19 Thread Carlos Hanson
Greetings, I am using the current svn checkout of the trunk and would like to include the multiple-db-support branch. What is the best way to do this? I will understand if the answer is read the svn manual (it's on my list of things to do). Thanks. Carlos H

Re: As if multiple-db wasn't hard enough :(...

2007-07-02 Thread Ben Ford
Hi Malcolm, Thanks for the well thought out response... I've had a bit more of a think about it over lunch and the metaclass bit is a non starter: it's instantiation I need to worry about not class creation. In theory I will always know which database to find RANObjects and their related models in.

Re: As if multiple-db wasn't hard enough :(...

2007-07-02 Thread Malcolm Tredinnick
On Tue, 2007-07-03 at 11:51 +0700, Ben Ford wrote: > Hi All, > > I have a bit of an issue that I'd like to kick around here before I > start diving into it... > > I'm using the multi-db branch, which I've recently merged all of the > latest stuff in trunk into. It's all working quite nicely, my

As if multiple-db wasn't hard enough :(...

2007-07-02 Thread Ben Ford
Hi All, I have a bit of an issue that I'd like to kick around here before I start diving into it... I'm using the multi-db branch, which I've recently merged all of the latest stuff in trunk into. It's all working quite nicely, my app runs on PostgreSQL and I have to talk to an Oracle database as

RE: Using newforms for multiple db rows

2007-05-14 Thread Chris Brand
> I think if it were me I'd build a form builder function, metaclass, or > do it in __init__. Probably the easiest is passing in an argument to > __init__ , that gives enough information to build the form. That sounds like the kind of thing I'm looking for. Thanks very much once again, Chris

Re: Using newforms for multiple db rows

2007-05-11 Thread dballanc
If any two inputs have the same name, both values are returned in a list ala [request.POST.getlist('score')] With the checkboxes it's easy to identify by value. I assume you might be able to figure out where that score belongs by order, but I'm not sure order is guaranteed. I think if it were me

RE: Using newforms for multiple db rows

2007-05-11 Thread Chris Brand
After a few false starts, I managed to get this going. Now my problem is that this approach only really works for Booleans. What if I wanted a form to enter test scores for a class, one score per student ? All my approaches so far have ended up with multiple fields with the same name, which then d

RE: Using newforms for multiple db rows

2007-05-04 Thread Chris Brand
> For the attendance form, you might use a MultipleChoiceField > checkboxSelectMultiple widget, where the value of each choice is set > to the pk of the student model. You should get a list of id's that > were checked when the form gets submitted. Thank you very much. Sounds like that approach

Re: Using newforms for multiple db rows

2007-05-03 Thread dballanc
Don't try too hard to directly link form to model. For the attendance form, you might use a MultipleChoiceField checkboxSelectMultiple widget, where the value of each choice is set to the pk of the student model. You should get a list of id's that were checked when the form gets submitted. Som

Using newforms for multiple db rows

2007-05-03 Thread Chris Brand
I've been reading all about newforms and playing a little, but I can't see how to approach what I want to do. Say I wanted to do something like a class attendance form, where my model has a class Student, and I want a form with a checkbox for each student to allow me to say whether they were pres

a question about django's branch "multiple-db-support"

2006-11-19 Thread [EMAIL PROTECTED]
I have install multiple-db-support branch, and write some code like that: #settings.py DATABASE_ENGINE = 'mysql' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. DATABASE_NAME = 'django' # Or path to database fil