﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
12286	Table for Model that has been proxied may not be created	Marc Fargas	nobody	"Hi there,

Imagine you have

app1/models.py::
{{{
#!python

    from app2.models import NiceModel
    class ProxyModel(NiceModel):
        class Meta:
            proxy = True
}}}

app2/models.py::
{{{
#!python

   from django.db import models

   class NiceModel(models.Model):
       pass
}}}

With this code, ""manage.py syncdb"" will likely first ""see"" 'ProxyModel'. In [source:django/trunk/django/core/management/commands/syncdb.py#11780 syncdb.py]:

  *  It will 'try' to (line 70) create a table for it, without doing anything.
  *  But adding ""app2_nicemodel"" (line 82) to the list of tables ""it has  taken care of""
  *  For that, when syncdb passes throught NiceModel it won't create any table as 'app2_nicemodel' (line 66) appears as created.

To reproduce that you need syncdb to be taking into account the ""proxy"" models before the realones (may happen when the ""proxying"" app is alphabetically before the real one)."	Uncategorized	closed	Core (Management commands)	1.1	Normal	fixed		rvdrijst	Accepted	1	0	0	1	0	0
