Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#16538 closed Bug (needsinfo)

Models fail to sync when using multiple app_label in same models.py

Reported by: George Marshall Owned by: nobody
Component: Database layer (models, ORM) Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

from django.db import models

class ModelOne(models.Model):
    # fields

    class Meta:
        app_label = 'app_one'

class ModelTwo(models.Model):
    # fields

    class Meta:
        app_label = 'app_two'

In the above example ModelOne will not create a table in the database but ModelTwo will.

Change History (2)

comment:1 by Ramiro Morales, 13 years ago

Resolution: needsinfo
Status: newclosed

What's the use case of having models from one models module in more than one app? What's the name of the app containing these models?. With the data given in the report, seems to me like stretching that app_label facility too far and possibly using it for something too different from what it has been created for.

in reply to:  1 comment:2 by George Marshall, 13 years ago

Replying to ramiro:

What's the use case of having models from one models module in more than one app? What's the name of the app containing these models?. With the data given in the report, seems to me like stretching that app_label facility too far and possibly using it for something too different from what it has been created for.

The use case is in a multi-db setup partitioning the models between multiple databases.

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