Ah, ok. I think you need to put your tables at the bottom, after
auth.define_tables()
so that the auth_user table is created before your tables.
My model file :
db.define_table('image',
Field('title'),
Field('file', 'upload'),
Field('description', 'text'),
Field('date', 'datetime', default=request.now),
Field('user', db.auth_user, default=auth.user_id),
Field('rating', default=0))
db.define_table('comment',
Field('ima
I guess that means you are not using authentication. How did you set up your
application in the first place? Can you delete it and start over with a "New
simple application"?
If you don't want to start over, make sure you have these lines in a model
file.
from gluon.tools import Mail, Auth
mai
And I got this error when using the code you supplied
Traceback (most recent call last):
File "C:\Users\Drise\Desktop\web2py\gluon\restricted.py", line 188,
in restricted
exec ccode in environment
File "C:/Users/Drise/Desktop/web2py/applications/***/models/db.py",
line 15, in
Field('u
No I would require them to login to post. They can login at index but
its not required, it only displays content.
And I'll try that code in a sec, let you know.
On Jun 13, 4:14 pm, pbreit wrote:
> Are users logged in? Usually you do it like this:
> Field('created_by', db.auth_user, default=auth.
Are users logged in? Usually you do it like this:
Field('created_by', db.auth_user, default=auth.user_id)
Do you allow users to inset an image without registering or logging in? If
so, you may need to handle it differently, possibly with an onvalidation
function that accounts for there being no
6 matches
Mail list logo