Hi Jon.  I believe you can use the Django model meta property db_table to
specify the schema.  According to ticket
#6064<http://code.djangoproject.com/ticket/6064>you need to use
somewhat hackneyed syntax at the moment (notice the outer
single quotes and the explicit inner double quotes):

class MyModel(models.Model) :
  . . .

  class Meta :
    db_table = '"accounting"."mymodel"'

It looks like ticket #6064 addresses putting schemas into your search order
for search purposes, but not explicitly specifying schemas for lookup or
table creation.  Unless the PostgreSQL quote function is made smarter before
1.0, it's probably a good idea for you to continue to use this syntax.


  -- Scott

On Fri, Jul 11, 2008 at 9:50 AM, Jon Brisbin <[EMAIL PROTECTED]> wrote:

>
> I hardly ever put anything in the Postgres "public" schema except for
> things I want exposed to all applications and tables within a
> database. I usually segregate the tables into schemas based on their
> relationship to one another. With several hundred tables in the
> database, this gets pretty critical. I noticed Django doesn't have any
> explicit schema support, but instead uses app prefixes. I realize that
> some would argue that's functionally equivalent. But not when you're
> looking at all those tables in pgAdmin.
>
> Would it be difficult to add schema support for those databases that
> support it rather than using the app_table naming methodology? Just
> create a schema called "app" and then the table named after the model.
> I guess it's really a personal preference, but I'm used to working
> with schemas because of the large number of tables in our warehouse.
> Maybe we're unusual in how heavily we rely on Postgres, but it's a
> convention that I've grown to prefer over the past several years. It
> also prevents me from using Django in our mission-critical apps
> because all our tables are segregated into schemas and we use several
> tables in different schemas. I don't get the impression that Django is
> necessarily targeted at the large, enterprise environment, but I would
> prefer to use Django over how we do it now (JBoss and SQL, of course :).
>
> Thanks!
>
> Jon Brisibn
> http://jbrisbin.com
>
>
> >
>


-- 
http://scott.andstuff.org/ | http://truthadorned.org/

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

Reply via email to