I have build a quite functionnal Dynamic models loader module, thanks to
Justinn help. I still have a problem though. The syncdb command to
create the table seems to mess up the admin, as it then appear it
english and not in french anymore. This is not a real problem but in
production with mod_python it messes up things.
On the wiki page about dynamic models I saw a workaround to avoid using
syncdb:
def install(model):
from django.core.management import sql, color
from django.db import connection
# Standard syncdb expects models to be in reliable locations,
# so dynamic models need to bypass django.core.management.syncdb.
# On the plus side, this allows individual models to be installed
# without installing the entire project structure.
# On the other hand, this means that things like relationships and
# indexes will have to be handled manually.
# This installs only the basic table definition.
# disable terminal colors in the sql statements
style = color.no_style()
cursor = connection.cursor()
statements, pending = sql.sql_model_create(model, style)
for sql in statements:
cursor.execute(sql)
but it uses a function sql.sql_model_create which doesn't exist anymore.
Is there another one which could make the job ?
Regards,
--
Guillaume