Django-nonrel:重置应用程序的语法 [英] Django-nonrel: Syntax to Reset an App

查看:107
本文介绍了Django-nonrel:重置应用程序的语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

To reset my app, I ran this:

./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中重置一个模型?

How do I reset a Model in Django-nonrel?

推荐答案

./manage.py reset node




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

executes sqlreset to create DROPT TABLE and CREATE TABLE SQL statements for the given app.

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

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

This does not work with the App Engine Datastore, because the Datastore is schemaless so there is no need for CREATE/DROP table commands.

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

If you want to delete existing model from the datastore, you can use the App Engine Development Console to delete all entities of the model (just make sure you use the correct port when accessing the Development Console) .

这篇关于Django-nonrel:重置应用程序的语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆