Opened 18 years ago

Last modified 10 years ago

#2225 closed defect

'manage.py sql ...' gets confused when using tables from separate apps — at Version 1

Reported by: Lucas Hazel Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: minor Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Adrian Holovaty)

An error message is given when using tables from a separate app if the table doesn't previously exist.

For example:

# project.app_a.models
class A(models.Model):
    # ....

# project.app_b.models
from project.app_a.models import A
class B(models.Model):
    a = models.ForeignKey(A)
    # ....

Then run python manage.py sql and you will recieve a comment claiming table app_a_a can not be referenced as it does not exist, yet the output clearly shows the table begin created.

However if one syncs the db, the tables are created and referenced despite the error message. This may be confusing to developers.

Change History (1)

comment:1 by Adrian Holovaty, 18 years ago

Description: modified (diff)
Summary: 'manage.py sql ...' gets confused when using tables from seperate apps'manage.py sql ...' gets confused when using tables from separate apps
Note: See TracTickets for help on using tickets.
Back to Top