Interesting problem I've encountered.
I'm getting the error: *<type 'exceptions.SyntaxError'> invalid
table/column name "comment" is a "ALL" reserved SQL/NOSQL keyword*
*
*
after defining my tables as such:
# define tables for blog posts
db.define_table('post',
Field('title', unique=True),
Field('body', 'text'),
format = '%(title)s')
# define tables for comments on a blog post
db.define_table('comment',
Field('post_id', 'reference post'),
Field('author'),
Field('email'),
Field('body', 'text'))
db.post.title.requires = IS_NOT_IN_DB(db, db.post.title)
db.post.body.requires = IS_NOT_EMPTY()
db.comment.post_id.requires = IS_IN_DB(db, db.post.id, '%(title)s')
db.comment.author.requires = IS_NOT_EMPTY()
db.comment.email.requires = IS_EMAIL()
db.comment.body.requires = IS_NOT_EMPTY()
Comment isn't a reserved keyword by mysql from what I have looked up. I've
tried to look this up in google and got nowhere, so here I am again. xD
Currently self-teaching myself python and web2py and do plan to pay it
forward to open-source in the future and all help is appreciated in advance!
-Jeremy
--
---
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/groups/opt_out.