Trying to populate:
db.define_table('comment',
Field('post_id', 'reference post'),
Field('parent_comment', 'reference comment'),
Field('body', 'text', requires=IS_NOT_EMPTY()),
Field('votes', 'integer'),
auth.signature)
with:
if db(db.comment).count()<2:
populate(db.comment, 50)
db.commit()
but getting "IntegrityError: FOREIGN KEY constraint failed" unless I remove
'reference
comment'
Is gluon.contrib.populate able to seed a table with a self reference?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.