Opened 18 years ago

Last modified 10 years ago

#2225 closed defect

'manage.py sql ...' gets confused when using tables from seperate apps — at Initial Version

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

An error message is given when using tables from a seperate 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 (0)

Note: See TracTickets for help on using tickets.
Back to Top