1

为了重置我的应用程序,我运行了这个:

./manage.py reset node

它给了我这个错误输出:

WARNING:root:The rdbms API is not available because the MySQLdb library could not be loaded.
Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_manager(settings)
  File "/home/a/mywebsites/django/seperolinux/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/home/a/mywebsites/django/seperolinux/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/a/mywebsites/django/seperolinux/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/a/mywebsites/django/seperolinux/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/a/mywebsites/django/seperolinux/django/core/management/base.py", line 286, in handle
    app_output = self.handle_app(app, **options)
  File "/home/a/mywebsites/django/seperolinux/django/core/management/commands/reset.py", line 35, in handle_app
    sql_list = sql_reset(app, self.style, connection)
  File "/home/a/mywebsites/django/seperolinux/django/core/management/sql.py", line 107, in sql_reset
    return sql_delete(app, style, connection) + sql_all(app, style, connection)
  File "/home/a/mywebsites/django/seperolinux/django/core/management/sql.py", line 66, in sql_delete
    table_names = connection.introspection.get_table_list(cursor)
AttributeError: 'DatabaseIntrospection' object has no attribute 'get_table_list'

如何在 Django-nonrel 中重置模型?

4

1 回答 1

2
./manage.py reset node

执行sqlreset为给定的应用程序创建 DROPT TABLE 和 CREATE TABLE SQL 语句。

https://docs.djangoproject.com/en/1.3/ref/django-admin/#reset-appname-appname

这不适用于 App Engine 数据存储区,因为数据存储区是无模式的,因此不需要 CREATE/DROP 表命令。

如果要从数据存储区中删除现有模型,可以使用App Engine 开发控制台删除模型的所有实体(只需确保在访问开发控制台时使用正确的端口)。

于 2012-07-08T11:52:05.413 回答