Getting InspectDB to work with postgres

2023-02-27 Thread Kyle Wan
Hi, I'm new to Django, and I'm struggling to get inspectdb to populate postgres models as json, hstore, or array objects. I have put `django.contrib.postgres` under the INSTALLED_APPS and I have psycopg2 installed. I have set my engine to be postgresql and am able to use the makemig

Re: How to use inspectdb to generate a model for a table owned by a specific schema.

2021-09-09 Thread Hello Singh
I am intermediate django developer, I want to give a try to your questions. Simply use this command *python manage.py inspectdb [ TABLE_NAME ]* *If you use this command without table name it inspect all tables of database* On Thu, 9 Sep 2021, 19:39 Nemani Srinivas Murthy, wrote: > Hi,

Re: How to use inspectdb to generate a model for a table owned by a specific schema.

2021-09-09 Thread carlos
Hi, read this maybe help you! https://stackoverflow.com/questions/21986917/running-inspectdb-on-a-specific-schema On Thu, Sep 9, 2021 at 8:09 AM Nemani Srinivas Murthy wrote: > Hi, I'm looking for a solution for generating the model.py file for a > table which is owned by a spec

How to use inspectdb to generate a model for a table owned by a specific schema.

2021-09-09 Thread Nemani Srinivas Murthy
Hi, I'm looking for a solution for generating the model.py file for a table which is owned by a specific schema ., I tried the below option but no luck. *python manage.py inspectdb --database= * -- You received this message because you are subscribed to the Google Groups "Dj

inspectdb errors: missing 1 required positional argument: 'collation'

2021-06-23 Thread Stephan van Beerschoten
I'm trying to recreate my models using inspectdb, but for some reason I'm now getting this output in my file: from django.db import models # Unable to inspect table 'AAA' # The error was: () missing 1 required positional argument: 'collation' # Unable to inspe

Re: inspectdb traceback

2019-02-01 Thread Tim Graham
version of Django. >> >> On Friday, February 1, 2019 at 7:50:11 AM UTC-5, christia...@itsv.at >> wrote: >>> >>> >>> while trying to build an app around an existing database, inspectdb >>> bails out on me. the server is running fine and says &

Re: inspectdb traceback

2019-02-01 Thread Tim Graham
You must use an older version of mysqlclient for such an old (and unsupported) version of Django. On Friday, February 1, 2019 at 7:50:11 AM UTC-5, christia...@itsv.at wrote: > > > while trying to build an app around an existing database, inspectdb bails > out on me. the server is

Re: inspectdb traceback

2019-02-01 Thread christian . tremel
an old (and > unsupported) version of Django. > > On Friday, February 1, 2019 at 7:50:11 AM UTC-5, christia...@itsv.at > wrote: >> >> >> while trying to build an app around an existing database, inspectdb bails >> out on me. the server is running fine and says

inspectdb traceback

2019-02-01 Thread christian . tremel
while trying to build an app around an existing database, inspectdb bails out on me. the server is running fine and says "0 errors found". any ideas ? root@lpgaixmgmtlx01:/root/django/aixregistry_nxt>./manage.py runserver 0.0. 0.0:8000 Validating models... 0 errors found February

Django 2.1 inspectdb supports Oracle ?

2018-10-11 Thread pk
The [version 2.0 docs][https://docs.djangoproject.com/en/2.0/ref/django-admin/#django-admin-inspectdb] states, "inspectdb works with PostgreSQL, MySQL and SQLite. Foreign-key detection only works in PostgreSQL and with certain types of MySQL tables.". This seems to exclude O

Re: python manage.py inspectdb > models.py crashing with KeyError: options['no-color']

2018-07-24 Thread Mikhailo Keda
what version of django are you using? On Tue, Jul 24, 2018 at 11:05 AM, dean raemaekers wrote: > Hello, > > I am trying to use inspectdb to generate models for a legacy database. I > get the following error: > > $ python custom_inspectdb.py > > Traceback (most rec

python manage.py inspectdb > models.py crashing with KeyError: options['no-color']

2018-07-24 Thread dean raemaekers
Hello, I am trying to use inspectdb to generate models for a legacy database. I get the following error: $ python custom_inspectdb.py Traceback (most recent call last): File "custom_inspectdb.py", line 8, in Command().execute(table_name_filter=lambda table_name: table_name

RE: python manage.py inspectdb makes all fields with a default valueblank=True, null=True

2018-07-20 Thread Kimball Leavitt
Good to know, I’ll keep that in mind. Yes, I was mistaken. And I guess I missed that line in the docs. Thanks! From: Tim Graham Sent: Friday, July 20, 2018 4:54 PM To: Django users Subject: Re: python manage.py inspectdb makes all fields with a default valueblank=True, null=True For future

Re: python manage.py inspectdb makes all fields with a default value blank=True, null=True

2018-07-20 Thread Tim Graham
(not info.column_default) corresponds to row[6] in inspectdb. In your example, test_field int(11) DEFAULT 1 seems to be nullable (according to the MySQL documentation, "If neither NULL nor NOT NULL is specified, the column is treated as though NULL had been specified." -- I guess it

Re: python manage.py inspectdb makes all fields with a default value blank=True, null=True

2018-07-20 Thread Kimball Leavitt
Will do. Thanks. On Friday, July 20, 2018 at 1:06:45 PM UTC-6, Jason wrote: > > Nice edge case you found. I would suggest raising this to the > django-developer > s to get core > framework dev attention or make a bug report on the trac

Re: python manage.py inspectdb makes all fields with a default value blank=True, null=True

2018-07-20 Thread Jason
Nice edge case you found. I would suggest raising this to the django-developer s to get core framework dev attention or make a bug report on the tracker. -- You received this message because you are subscribed to the Google Groups "Dj

python manage.py inspectdb makes all fields with a default value blank=True, null=True

2018-07-20 Thread Kimball Leavitt
I'm not sure if this is a bug, feature request, or something else, so I thought I'd start here. Summary: *python manage.py inspectdb* makes all fields with a default value *blank=True, null=True* I'm using: - Ubuntu 16.04 - Python 3.7.0 - Django 2.0.4 -

Re: python inspectdb got "The error was: function unnest(smallint[]) does not exist"

2018-06-21 Thread Melvyn Sopacua
On woensdag 20 juni 2018 19:12:00 CEST weiwei.hs...@keeptruckin.com wrote: > When I run "python3 manage.py inspectdb", I got below error messages: > > > # Unable to inspect table 'eld_messages' > > # The error was: function unnest(smallint[]) does not exi

python inspectdb got "The error was: function unnest(smallint[]) does not exist"

2018-06-20 Thread weiwei . hsieh
USER': 'my_username', 'PASSWORD': 'my_password', 'HOST': 'my_hostname', 'PORT': 5439, }, } When I run "python3 manage.py inspectdb", I got below error messages: # Unable to inspect table 'eld_me

Re: Default for varbinary in inspectdb

2018-03-20 Thread Kevin Olbrich
PS: After changing the field to BinaryField, read / write works beautiful. Am Dienstag, 20. März 2018 14:49:35 UTC+1 schrieb Kevin Olbrich: > > Hi, > > I just noticed a problem with varbinary fields and inspectdb. > When inspectdb processes all fields, it creates varbinary as Char

Default for varbinary in inspectdb

2018-03-20 Thread Kevin Olbrich
Hi, I just noticed a problem with varbinary fields and inspectdb. When inspectdb processes all fields, it creates varbinary as CharField but it needs to be BinaryField. Using CharField it is impossible to store non-ASCII (non-text) content in these columns. I noticed that problem when I tried

inspectDB and 'id' can only be used as a field name if the field also sets 'primary_key=True'.

2017-03-23 Thread Camilo Torres
Hi. You should rename the "id" field in your model to something else. You can edit your models.py and put another name, like "dbid" or something. Django models reserve the "id" field for primary key; your table has another field as primary key. -- You received this message because you are sub

inspectDB and 'id' can only be used as a field name if the field also sets 'primary_key=True'.

2017-03-23 Thread Carl Brewer
G'day, Very new to Django, I'm trying to connect to an existing MySQL database that I am not familiar with. I used inspectDB to load up the database models.py file, and am seeing these errors for some of the tables : 'id' can only be used as a field name if the field als

Re: inspectdb on different Oracle schemas

2015-05-06 Thread Stephen J. Butler
Yes, I've done this with a schema from a vendor app I wanted to read. Define additional database aliases, one per schema, and then when running inspectdb use the "--database" parameter with the alias name. On Wed, May 6, 2015 at 2:42 AM, Shekar Tippur wrote: > > > Hell

inspectdb on different Oracle schemas

2015-05-06 Thread Shekar Tippur
Hello, Is there a way to run inspactdb on different schemas? I have around 3 schemas and when I run inspectdb, I get details from just 1 schema. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.oracle', 'NAME': '(D

Re: Incremental inspectdb, anyone?

2014-10-15 Thread Mike Dewhirst
, and (c) dealing with the problems that these alterations and deletions may cause for existing app code. The last point in particular is a big hurdle. So level 4 functionality may not be worth the effort Why not do it the other way around? Use inspectdb to produce the new models.py and just move

Incremental inspectdb, anyone?

2014-10-15 Thread Ken Winter
e a Django model for every table in it. This is what inspectdb does. It's fine for initializing a Django app that doesn't already contain any data models. Level 1 functionality is easiest to implement, because the utility doesn't have to look at the existing model set at all. 2

Re: inspectdb and postgresql schemas support - ticket #22673

2014-05-21 Thread Russell Keith-Magee
On Thu, May 22, 2014 at 3:33 AM, Fabio Caritas Barrionuevo da Luz < bna...@gmail.com> wrote: > *Django not provides way to use inspectdb in a postgresql schema with name > different of "public"* > > If you think this is an important feature and should be included i

inspectdb and postgresql schemas support - ticket #22673

2014-05-21 Thread Fabio Caritas Barrionuevo da Luz
*Django not provides way to use inspectdb in a postgresql schema with name different of "public"* If you think this is an important feature and should be included in django, Please send your considerations and use cases to the topic: https://groups.google.com/forum/#!topic/django-

How to use inspectdb command for postgres table in Django

2014-04-03 Thread Shoaib Ijaz
I am trying to generate Model class from postgres table, this table contain some geometry type column. I am using following command for Model creation python manage.py inspectdb But facing this error Exception: Could not find a geometry or geography column for "accommodation"

Re: inspectdb option and DJango normal operations

2013-02-01 Thread carlos
yes and not why syncdb create a other tables for example auth, content_type etc and inspectdb only tables databases old Cheers On Thu, Jan 31, 2013 at 12:03 PM, wrote: > If I use the inspectdb command to create models.py file from existing > database schema would it function the same

inspectdb option and DJango normal operations

2013-01-31 Thread arc4gold
If I use the inspectdb command to create models.py file from existing database schema would it function the same way as if I had created the tables using the syncdb command.? Thanks -- You received this message because you are subscribed to the Google Groups "Django users"

inspectdb doesn't introspect foreign key constraints in SQLite?

2012-10-16 Thread Larry Knibb
I generated a models.py from an existing SQLite database using django-admin.py inspectdb but it is missing the foreign key definitions. https://docs.djangoproject.com/en/dev/ref/django-admin/#inspectdb says it's not supported in SQLite (only PostgresSQL and some MySQL scenarios) but then

Re: inspectdb() sees MSSQL varchar([n]) fields as type textfield

2012-06-13 Thread rico_suave
elatively new to Django and currently implementing a > > system where we use inspectdb to use an existing MSSQL 2005 database from > > within Django. > > We have encountered different problems with the ORM part of the application > > in combination with MSSQL, most of which we

Re: inspectdb() sees MSSQL varchar([n]) fields as type textfield

2012-06-11 Thread Russell Keith-Magee
On Mon, Jun 11, 2012 at 4:26 PM, rico_suave wrote: > Hi All, > > We (as a company) are relatively new to Django and currently implementing a > system where we use inspectdb to use an existing MSSQL 2005 database from > within Django. > We have encountered different problems wi

inspectdb() sees MSSQL varchar([n]) fields as type textfield

2012-06-11 Thread rico_suave
Hi All, We (as a company) are relatively new to Django and currently implementing a system where we use inspectdb to use an existing MSSQL 2005 database from within Django. We have encountered different problems with the ORM part of the application in combination with MSSQL, most of which we

Re: inspectdb+oracle

2012-05-08 Thread Jani Tiainen
AL16UTF16 NCHAR ) When I try django-admin.py inspectdb I get the following error: ..."indexes = connection.introspection.get_indexes(cursor, table_name) File "/usr/lib/pymodules/python2.6/django/db/backends/oracle/ introspection.py", line 116, in get_indexes for row in c

inspectdb+oracle

2012-05-08 Thread mapapage
t and AL16UTF16 NCHAR character set, import server uses AL32UTF8 character set, export client uses EL8MSWIN1253 character set and AL16UTF16 NCHAR ) When I try django-admin.py inspectdb I get the following error: ..."indexes = connection.introspection.get_indexes(cursor, table_name) File

Re: Problem creating foreign key on a model created by inspectdb

2012-02-28 Thread Joel Goldstick
On Tue, Feb 28, 2012 at 3:24 PM, Joel Goldstick wrote: > I have a legacy database from which I created a model called 'LandSupplier' > >    class LandSupplier(models.Model): >        landsupplierid = models.AutoField(primary_key=True, > db_column='LandSupplierId') # Field name made lowercase. >  

Problem creating foreign key on a model created by inspectdb

2012-02-28 Thread Joel Goldstick
I have a legacy database from which I created a model called 'LandSupplier' class LandSupplier(models.Model): landsupplierid = models.AutoField(primary_key=True, db_column='LandSupplierId') # Field name made lowercase. ... class Meta: db_table = u'LandSuppli

Re: django-admin inspectdb does not detect NULL columns for PostgreSQL database

2011-07-22 Thread Andre Terra
Didn't read the original question, so excuse me for not replying. And thanks/congrats on the new patch =) Cheers, AT On 7/22/11, Ricardo L. Dani wrote: > FYI i fixed that and post a patch in the ticket. > > Regards > > On Thu, Jul 21, 2011 at 9:21 AM, Ricardo L. Dani > wrote: >> Hi everyone, >

Re: django-admin inspectdb does not detect NULL columns for PostgreSQL database

2011-07-22 Thread Ricardo L. Dani
FYI i fixed that and post a patch in the ticket. Regards On Thu, Jul 21, 2011 at 9:21 AM, Ricardo L. Dani wrote: > Hi everyone, > > I have the same problem of this ticket from django trac: > https://code.djangoproject.com/ticket/7783 > > The PostgreSQL database introspection does not detect NULL

django-admin inspectdb does not detect NULL columns for PostgreSQL database

2011-07-21 Thread Ricardo L. Dani
Hi everyone, I have the same problem of this ticket from django trac: https://code.djangoproject.com/ticket/7783 The PostgreSQL database introspection does not detect NULL columns, cursor.description does not return the null_ok field, so database introspection does not add null=True to column def

Re: how to select tables in inspectdb?

2011-03-25 Thread Jani Tiainen
On Thursday 24 March 2011 22:07:53 Savio Sabino wrote: > Hi. > How I select what tables (in a db with 900 tables) has the model > generated for inpectdb? Better yet, real life has pointed out that doing models by hand (even for legacy database) gives out better results than automation. You just

Re: how to select tables in inspectdb?

2011-03-24 Thread Jacob Kaplan-Moss
On Thu, Mar 24, 2011 at 3:07 PM, Savio Sabino wrote: > How I select what tables (in a db with 900 tables) has the model > generated for inpectdb? Sorry, but you can't: you'll need to run inspectdb and then edit the generated code by hand to edit out the models you don't

how to select tables in inspectdb?

2011-03-24 Thread Savio Sabino
Hi. How I select what tables (in a db with 900 tables) has the model generated for inpectdb? -- 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

Re: Problem importing model after inspectdb

2010-09-24 Thread bruno desthuilliers
On 24 sep, 02:33, Ivan wrote: > Hi all, > I'm trying to build a Django project by working through the handbook > but I'm having some problems accessing the database by referencing the > model I've created from it (by inspectdb). When attemping to do some > "Bas

Re: Problem importing model after inspectdb

2010-09-23 Thread Karen Tracey
On Thu, Sep 23, 2010 at 8:33 PM, Ivan wrote: > Hi all, > I'm trying to build a Django project by working through the handbook > but I'm having some problems accessing the database by referencing the > model I've created from it (by inspectdb). When attemping to d

Problem importing model after inspectdb

2010-09-23 Thread Ivan
Hi all, I'm trying to build a Django project by working through the handbook but I'm having some problems accessing the database by referencing the model I've created from it (by inspectdb). When attemping to do some "Basic Data Access" (Chapter 5) I can't import t

inspectdb Traceback occurring immediately after interruption

2010-03-10 Thread Chris Young
anged Author: mtredinnick Last Changed Rev: 12743 Last Changed Date: 2010-03-10 11:41:41 +0800 (Wed, 10 Mar 2010) I was running python manage.py inspectdb on a database with hundreds of tables and it "hung" for several minutes on a complicated view. Intending to remove the view then re-

Re: inspectdb question

2010-02-02 Thread Karen Tracey
On Mon, Feb 1, 2010 at 11:32 PM, Mike wrote: > Hi, > > I've tried to import my legacy MySQL database using > > python manage.py inspectdb --database=myolddb >>models.py > > and found that all varchar(N) fields became models.CharField > (max_length=3*N,...) >

inspectdb question

2010-02-02 Thread Mike
Hi, I've tried to import my legacy MySQL database using python manage.py inspectdb --database=myolddb >>models.py and found that all varchar(N) fields became models.CharField (max_length=3*N,...) i.e. three times longer. Is it a bug or an expected behavior? BTW I use trunk rev

Re: inspectdb throws "_mysql_exceptions.Warning: Can't read dir of './test/' (errno: 13)"

2009-11-27 Thread NicoEchániz
h root:root privileges instead of mysql:mysql. Changing that, solved the problem. It had nothing to do with inspectdb or Django whatsoever, but the Warning was preventing inspectdb from working correctly. cheers, NicoEchániz -- You received this message because you are subscribed to the Google

Re: inspectdb Oracle

2009-10-28 Thread gillengam
gt; views (he is not the owner). I used command "python manage.py > >inspectdb> models.py", but I got only user's tables and I need > > also the two views. How can I do? Is it possible? > > > Thanks > > I usually create a table using something s

Re: inspectdb Oracle

2009-10-26 Thread Mark (Nosrednakram)
On Oct 26, 4:43 am, gillengam wrote: > Hi, I must develop an application that use Oracle database. The Oracle > connection user is the owner of some tables, but he can only read two > views (he is not the owner). I used command "python manage.py > inspectdb > models.py&quo

Re: inspectdb Oracle

2009-10-26 Thread Jani Tiainen
gillengam kirjoitti: > Hi, I must develop an application that use Oracle database. The Oracle > connection user is the owner of some tables, but he can only read two > views (he is not the owner). I used command "python manage.py > inspectdb > models.py", but I got only

inspectdb Oracle

2009-10-26 Thread gillengam
Hi, I must develop an application that use Oracle database. The Oracle connection user is the owner of some tables, but he can only read two views (he is not the owner). I used command "python manage.py inspectdb > models.py", but I got only user's tables and I need also

Re: inspectdb generates CharFields with 3x max_length

2009-10-09 Thread Karen Tracey
angoproject.com/search?q=MySQL+inspectdb+length&noquickjump=1&ticket=on is how I found the ticket for this issue. Karen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: inspectdb generates CharFields with 3x max_length

2009-10-09 Thread Brian Morton
Discussion in the ticket seems to think that the "right" > answer to return is going to be dependent on the table charset (actually, it > would need to be column, since the charset can be set per-column). > > However, near as I can tell from a couple of brief experiments, that

Re: inspectdb generates CharFields with 3x max_length

2009-10-09 Thread Karen Tracey
charset can be set per-column). However, near as I can tell from a couple of brief experiments, that's not the case. For a latin1 encoded table with varchar(50) column the value determined by inspectdb is 150. Similarly, for a utf-8 encoded table with a varchar(32) column, the value determined

inspectdb generates CharFields with 3x max_length

2009-10-09 Thread Brian Morton
This is a very strange problem, so I thought I would post here and see if anyone else had seen this problem. I introspected a MySQL database with Python2.6 using Django SVN HEAD and it produced my models as expected. However, all CharFields have the max_length set to 3x the actual varchar field

Re: inspectdb and postgresql schema

2009-08-12 Thread Russell Keith-Magee
On Wed, Aug 12, 2009 at 6:09 PM, Marek Pietrucha wrote: > > Thank you for the anwser :) > > It's not comforting but now I don't have to dig the whole google > achieve ;) > > In this case, how do I construct django models? I don't want to seem rude, but we provide an extensive documentation for a

Re: inspectdb and postgresql schema

2009-08-12 Thread Marek Pietrucha
Thank you for the anwser :) It's not comforting but now I don't have to dig the whole google achieve ;) In this case, how do I construct django models? best regards, Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Re: inspectdb and postgresql schema

2009-08-11 Thread Russell Keith-Magee
On Tue, Aug 11, 2009 at 10:41 PM, Marek Pietrucha wrote: > > Hello, > > I have a relational database written in PostgreSQL 8.4. I use > different schemas - not default public schema. I tried to inspectdb my > database but the output was clean. It looked like the inspectdb tool &

inspectdb and postgresql schema

2009-08-11 Thread Marek Pietrucha
Hello, I have a relational database written in PostgreSQL 8.4. I use different schemas - not default public schema. I tried to inspectdb my database but the output was clean. It looked like the inspectdb tool didn't look in my schemas. I thought it was the matter of the pg driver, so I ch

Re: inspectdb and MySQL

2009-07-29 Thread Joshua Russo
On Wed, Jul 29, 2009 at 2:39 PM, Juanjo Conti wrote: > 2009/7/29 Joshua Russo : > > On Wed, Jul 29, 2009 at 12:35 PM, Juanjo Conti > wrote: > >> > >> In http://docs.djangoproject.com/en/dev/ref/django-admin/ i read > >> "inspectdb works wi

Re: inspectdb and MySQL

2009-07-29 Thread Juanjo Conti
2009/7/29 Joshua Russo : > On Wed, Jul 29, 2009 at 12:35 PM, Juanjo Conti wrote: >> >> In http://docs.djangoproject.com/en/dev/ref/django-admin/ i read >> "inspectdb works with PostgreSQL, MySQL and SQLite. Foreign-key >> detection only works in PostgreSQL

Re: inspectdb and MySQL

2009-07-29 Thread Joshua Russo
On Wed, Jul 29, 2009 at 12:35 PM, Juanjo Conti wrote: > > In http://docs.djangoproject.com/en/dev/ref/django-admin/ i read > "inspectdb works with PostgreSQL, MySQL and SQLite. Foreign-key > detection only works in PostgreSQL and with certain types of MySQL > tables."

inspectdb and MySQL

2009-07-29 Thread Juanjo Conti
In http://docs.djangoproject.com/en/dev/ref/django-admin/ i read "inspectdb works with PostgreSQL, MySQL and SQLite. Foreign-key detection only works in PostgreSQL and with certain types of MySQL tables." Could you tell me the preferred MySQL table types? Thanks, -- Ju

Re: inspectdb throws "_mysql_exceptions.Warning: Can't read dir of './test/' (errno: 13)"

2009-01-30 Thread dick...@gmail.com
for some more info, i debugged it down to this line: File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/db/backends/mysql/introspection.py", line 70, in get_relations AND referenced_column_name IS NOT NULL""", [table_name]) it seems the table_name i

inspectdb throws "_mysql_exceptions.Warning: Can't read dir of './test/' (errno: 13)"

2009-01-30 Thread dick...@gmail.com
pretty basic database i created using the "polls" tutorial, and now trying to test inspectdb (which i need to run against a legacy db). (fwiw, i tried creating a test dir, and didn't help) thanks, bash-3.2$ python manage.py inspectdb # This is an auto-generated Django model m

Re: inspectdb don't build model form MySQL

2008-07-18 Thread Karen Tracey
ngo thing? > > oh, and yeah all tables are in the same schema... > > Thanks in advance, > Are you absolutely sure the settings.py you are using are pointing to the database you expect? It looks like inspectdb is finding an empty database. Karen --~--~-~--~~--

inspectdb don't build model form MySQL

2008-07-18 Thread anoval
) REFERENCES ACTION(ACTION_ID) ) TYPE = INNODB; Ok this is not the whole sql there are many more tables, but the principle is the same everywhere. So when i put python manage.py inspectdb > models.py, it successfully finish it but the result is # This is an auto-generated Django model module. # You'

Re: sorting inspectdb output

2008-06-03 Thread [EMAIL PROTECTED]
I don't think there is an option for that.. On Jun 3, 3:16 pm, Vidja <[EMAIL PROTECTED]> wrote: > Thanks Carole, > > Didn't know this option. Is there a way to tell inspectdb to do that? > Would be a nice option. For now I will just change the file. > >

Re: sorting inspectdb output

2008-06-03 Thread Vidja
Thanks Carole, Didn't know this option. Is there a way to tell inspectdb to do that? Would be a nice option. For now I will just change the file. VidJa On 3 jun, 05:54, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > If a class is defined after it is being reference

Re: sorting inspectdb output

2008-06-02 Thread [EMAIL PROTECTED]
) # notice the quotes around the name class Table2(models.Model): table2_id = models.AutoField(primary_key=True) On May 30, 4:24 pm, Vidja <[EMAIL PROTECTED]> wrote: > I'm using manage inspectdb to get an initial list of models for my > database. The only thing is that I'

sorting inspectdb output

2008-05-30 Thread Vidja
I'm using manage inspectdb to get an initial list of models for my database. The only thing is that I'm spending a lot of time sorting the models (>300) in such a way that each class is in the right order regarding the foreign key dependencies. (making sure each model that points

Re: inspectdb and foreign keys

2008-04-03 Thread mthorley
olumn='category' as an argument on the > ForeignKey definition for category. Note the to_field argument is not > needed here, by default the to_field is assumed to be the target model's > primary key, and that is what you are using. > > Karen > > > On Apr 2, 6:12 pm,

Re: inspectdb and foreign keys

2008-04-02 Thread Karen Tracey
target model's primary key, and that is what you are using. Karen > On Apr 2, 6:12 pm, mthorley <[EMAIL PROTECTED]> wrote: > > Greetings, I used inspectdb to create my models and then tried editing > > the generated models in order to define the ForeignKey relations

Re: inspectdb and foreign keys

2008-04-02 Thread [EMAIL PROTECTED]
In your database ( not in the model ) rename the field 'category in table MdlCourse to category_id and it should fix the problem... normally a ForeignKey field name in the database is ClassName_id On Apr 2, 6:12 pm, mthorley <[EMAIL PROTECTED]> wrote: > Greetings, I used inspectd

inspectdb and foreign keys

2008-04-02 Thread mthorley
Greetings, I used inspectdb to create my models and then tried editing the generated models in order to define the ForeignKey relationships, and I'm getting an error. Here's what I have. Note: I commented out the original category field and tried adding my own Foreign

Re: Any way to get AutoField from inspectdb?

2008-03-08 Thread Malcolm Tredinnick
On Sat, 2008-03-08 at 19:18 -0600, Michael Hipp wrote: > I have a legacy database that happens to be PostgreSQL. It has this primary > key field: > > CREATE TABLE foo ( > id integer PRIMARY KEY, > > When I do 'inspectdb' it gives me a model with

Any way to get AutoField from inspectdb?

2008-03-08 Thread Michael Hipp
I have a legacy database that happens to be PostgreSQL. It has this primary key field: CREATE TABLE foo ( id integer PRIMARY KEY, When I do 'inspectdb' it gives me a model with this in it: class Foo(models.Model): id = models.IntegerField(primary_key=

Re: InspectDB showing up error

2008-02-13 Thread Karen Tracey
read/thread/2a5d168c19c5774/0d8a0b5b878ab4ab?lnk=gst&q=inspectdb+error#0d8a0b5b878ab4ab > The ticket referenced in that discussion ( http://code.djangoproject.com/ticket/2591) was fixed in July. That is after the 0.96 release of Django so in order to get it you will need to be running with an

Re: InspectDB showing up error

2008-02-13 Thread Sairam Krishnamurthy
Thanks Malcolmn, This issue was discussed already in this group. I saw that after posting the message. It had a fix. http://groups.google.com/group/django-developers/browse_thread/thread/2a5d168c19c5774/0d8a0b5b878ab4ab?lnk=gst&q=inspectdb+error#0d8a0b5b878ab4ab And i am new to django.

Re: InspectDB showing up error

2008-02-13 Thread Malcolm Tredinnick
On Wed, 2008-02-13 at 11:51 +0530, Sairam Krishnamurthy wrote: > Hi, > > I created a postgres db and tried to create model.py file using > inspectdb. > > I showed me the following error. > > from django.db import models > > class AuthMessage(models.Model): >

InspectDB showing up error

2008-02-12 Thread Sairam Krishnamurthy
Hi, I created a postgres db and tried to create model.py file using inspectdb. I showed me the following error. from django.db import models class AuthMessage(models.Model): Traceback (most recent call last): File "manage.py", line 11, in execute_manager(settings) File &q

Re: inspectdb and mssql

2007-06-11 Thread Malcolm Tredinnick
On Mon, 2007-06-11 at 17:21 -0500, Carl Karsten wrote: [...] > What all do I need to do to add a new backend? basically, I want to try > using > pymssql (work on linux) instead of adodbapi (which I am assuming adodbapi > only > works on win?) Add a new directory under django/db/backends/. It

Re: inspectdb and mssql

2007-06-11 Thread Carl Karsten
>>> track tickets. if the path gets too bumpy, switch to MySql. >>> >>> I have hit my first bump: >>> >>> settings.py DATABASE_ENGINE = 'ado_mssql' >>> and the rest of the stuff to connect to my db. >>> manage.py inspectd

Re: inspectdb and mssql

2007-06-11 Thread Malcolm Tredinnick
too bumpy, switch to MySql. > > > > I have hit my first bump: > > > > settings.py DATABASE_ENGINE = 'ado_mssql' > > and the rest of the stuff to connect to my db. > > manage.py inspectdb > > > > # This is an auto-generated Django model module. > > # Y

Re: inspectdb and mssql

2007-06-11 Thread Malcolm Tredinnick
' > and the rest of the stuff to connect to my db. > manage.py inspectdb > > # This is an auto-generated Django model module. > # You'll have to do the following manually to clean this up: > # * Rearrange models' order > # * Make sure each model has one fiel

inspectdb and mssql

2007-06-11 Thread Carl Karsten
th Ms, if I run into bumps submit track tickets. if the path gets too bumpy, switch to MySql. I have hit my first bump: settings.py DATABASE_ENGINE = 'ado_mssql' and the rest of the stuff to connect to my db. manage.py inspectdb # This is an auto-generated Django model module. # Yo

Re[2]: inspectdb support for ado_mssql?

2007-01-24 Thread Andrew Diederich
lly does much. > I haven't updated it to the latest SVN because of a lack of time, but > it shouldn't be too hard to figure out in case there are conflicts. That worked reasonably well. One bit of the diff didn't go cleanly, but I flailed around in tortoiseSVN until the error went aw

Re: inspectdb support for ado_mssql?

2007-01-24 Thread Sean De La Torre
't updated it to the latest SVN because of a lack of time, but it shouldn't be too hard to figure out in case there are conflicts. Sean On 1/23/07, Andrew Diederich <[EMAIL PROTECTED]> wrote: > > > Has anyone been able to get inspectdb working for 0.96-dev (svn) > django

inspectdb support for ado_mssql?

2007-01-23 Thread Andrew Diederich
Has anyone been able to get inspectdb working for 0.96-dev (svn) django? I just got my connect string working (non-standard port issue), but at first go it looks like inspectdb isn't yet supported for ado_mssql, which is too bad. Here's what happens when I run it: C:\eggs>dj

I tried running inspectdb TypeError: int() argument must be a string or a number

2006-10-09 Thread a
django-admin.py inspectdb --settings=settings > models.py Traceback (most recent call last): File "/home/mark/bin/django-admin.py", line 8, in ? management.execute_from_command_line() File "/usr/lib/python2.4/site-packages/django/core/management.

Re: error with inspectdb using oracle (v0.95)

2006-09-15 Thread world_domination_kites
OK. That change did make inspectdb work, however it wasn't the end of the story... # manage.py syncdb gave me an invalid character error. Fixed that in oracle/base.py FormatStylePlaceholderCursor with: def execute(self, query, params=[]): query = self.convert_arguments(query

Re: error with inspectdb using oracle (v0.95)

2006-09-14 Thread world_domination_kites
cx_Oracle seems to be DB-API compliant, no need to stuff about with those pesky oracle data-dictionary views. I did this: def get_table_description(cursor, table_name): "should return a DB-API cursor.description alike sequence" cursor.execute("SELECT * FROM %s WHERE 1=2" % quote_name(tabl

Re: error with inspectdb using oracle (v0.95)

2006-09-11 Thread Jeremy Dunck
On 9/11/06, DavidA <[EMAIL PROTECTED]> wrote: > ... > You could try implementing those three functions, using one of the > other backends as a starting point, but you'll need to be fairly > familiar with Oracle to get through it, me thinks. This will help: http://www.ss64.com/orad_v8/index.html

Re: error with inspectdb using oracle (v0.95)

2006-09-11 Thread DavidA
for line in action_mapping[action](): > File > "c:\python23\lib\site-packages\Django-0.95-py2.3.egg\django\core\management.py", > line 745, in inspectdb > field_type = introspection_module.DATA_TYPES_REVERSE[row[1]] > IndexError: string index out of range >

  1   2   >