Questions tagged [inspectdb]

55 questions
1
vote
1 answer

Using joined results for Django model with legacy database schema

I'm using Django 1.6 to provide administrative functionality to a legacy database using Django's built-in admin feature. I've used inspectdb to generate the models and cleaned them up appropriately, but there's one part that is bugging me. The…
Tom
  • 681
  • 8
  • 14
1
vote
1 answer

manage.py inspectdb and enums

A have a lot of tables and fields in them with enums. Is there an ability to inspect enums from MySQL like transit enum('yes','no') default 'no'? I see, by default it does not work. Also i have a wrong character length definition: ipaddr varchar(15)…
night-crawler
  • 1,409
  • 1
  • 26
  • 39
0
votes
1 answer

Why can't I use inspectdb command with terms table in Django project?

I'm trying to create a model for terms table in models.py file using inspectdb command in Django project. The terms table contains information about students and their GPA for three grades. I'm using Oracle 18 database and Django 3.2. When I try to…
Mohamed Emad
  • 186
  • 3
  • 5
0
votes
0 answers

Snowflake sample database tables are retrieved instead of my private database-Django-snowflake package

I have specified correct database config variable with all the required credentials of my local database that is hosted,but when I am trying to auto generate models for my tables from inspectdb command,I am receiving only SNOW_FLAKE_SAMPLE schema…
0
votes
1 answer

django admin site returns MultipleObjectsReturned exception with inspectdb imported legacy database and composite primary key

Using inspectdb, I have imported a legacy database, that contains entities with composite primary keys, in django . The database schema contains about 200 different entities and inspectdb is quite handy in that situation. This is the schema in…
Ilir
  • 430
  • 2
  • 7
  • 19
0
votes
0 answers

having error (1054, "Unknown column 'order_product.id' in 'field list'") in django

I create the models file with inspectdb, but it gives an error when I want to show it in Admin panel: (1054, "Unknown column 'order_product.id' in 'field list'") In my searches, I realized I had to add a primary key to each of the models, but…
yousof
  • 277
  • 5
  • 15
0
votes
0 answers

'utf-8' codec can't decode byte 0xe6 in position 3: invalid continuation byte

I'm writing the Django React application and I have a huge existing database. I created models using 'inspectdb' command... My database is a bit old and it is full of Croatian characters because of it models couldn't be created. Is there any line of…
0
votes
1 answer

Django legacy database inspectdb removes "_id" suffix from field names

I am having a problem using inspectdb in django for a legacy database. I believe my issue is essentially the opposite of what is described here: Django suffix ForeignKey field with _id Many field names in my database end with "_id". Upon running…
Dylan
  • 13
  • 3
0
votes
2 answers

Django: can't inspectdb database tables to file

I have a database with around 25 tables and I would like to automatically generate the model file for my python project. For developing the project I am using PyCharm with a MariaDB as RDMS. The basic settings for the database have been done. In the…
Perino
  • 608
  • 9
  • 30
0
votes
1 answer

After running inspectdb for POSTGIS DB, python manage.py runserver gives error (Django-2.2)

Running: python manage.py inspectdb --database=geoserver > map/models.py After: python manage.py runserver gives below errors: Watching for file changes with StatReloader Exception in thread Thread-1: Traceback (most recent call last): File…
Hassan Raza
  • 106
  • 12
0
votes
3 answers

Django unknown column error when trying to get a model objects

I'm trying to set up a web-app that modify an existing MySQL database using Dajngo, the model for my table below was generated via Django inspectdb: class BaseCase(models.Model): base_case_name = models.TextField(blank=True, null=True) …
Mehdi Selbi
  • 147
  • 2
  • 11
0
votes
1 answer

django// 1054, Unknown column 'rank.post_id_id' in 'field list'"

django=2.2.3 mariadb This error occurs after importing model from an existing database with 'inspectdb' and changed field properties. class Post(models.Model): post_id = models.AutoField(primary_key=True) post_name =…
Miguel
  • 377
  • 1
  • 17
0
votes
0 answers

How to inspect db in django2.1 with postgresql?

hi when i run python3 manage.py inspectdb it will return following error # The error was: sequence index must be integer, not 'slice' same python3 manage.py inspectdb working on sqlite when i use postgresql it will return error # Unable to inspect…
ArunKumar
  • 179
  • 1
  • 1
  • 11
0
votes
1 answer

How much can I rely on the inspectdb command of django for using a large legacy MySQL database?

I need to make a website portal for generating reports based on the activities in the library of my college. For that, I have been given a large database with more than 200 tables. Since I have done website development on django, I was hoping to use…
Raghav Arora
  • 148
  • 1
  • 14
0
votes
0 answers

How to Map table views of a legacy Database in Oracle to django models?

I am working on a project that requires connecting to an existing remote Oracle database. the problem is that the client has not given full access to the database. instead i'm only given accesss to some views(Relational Database View) of the…
Arun Laxman
  • 376
  • 2
  • 15