0
は、私はこのエラーを解決/逃れたと思った。しかし、今こだわっています私のdb.pyコード:。。のweb2py:IntegrityErrorは( 'NULL制約が故障していない:post.message
Post = db.define_table('post',
Field('message', 'text', requires=IS_NOT_EMPTY(), notnull=False),
Field('answers', 'text', requires=IS_NOT_EMPTY(), notnull=False),
auth.signature
)
Post.is_active.readable=False
Post.is_active.writeable=False
コントローラ:
@ auth.requires_login()私の見解で
def index():
db.post.answers.writable=False
db.post.answers.readable=False
form = SQLFORM(post, formstyle='divs')
if form.process().accepted:
pass
messages = db(post).select(orderby=~post.created_on)
.......code
#after several codes in now need to post a message to answers field, WITHOUT using a form in the view page
db.post.insert(answers=report)
:
{{for msg in messages:}}
code
{{=msg.message}}
{{report from answers field}}
私の問題は、エラーが続いていることです。IntegrityError( 'NOT NULL制約に失敗しました:post.message
このエラーを解決するにはどうすればよいですか?外部ツールを(DALは、そのような制約を削除することはできません)が必要NOT NULL
制約を除去するように、データベーステーブルは元々、後で影響を及ぼさないであろうnotnull=False
にモデルを変更すること、notnull=True
で作成された場合 種類
あなたは最初に 'notnull = True'を持っていましたか? – Anthony
はい私はそれを持っていた – wakamdr
http://www.mail-archive.com/[email protected]/msg12879.html .....このポストはトリックをした......デフォルト= – wakamdr